Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cookbook to latest API #4706

Merged
merged 6 commits into from
Feb 5, 2020
Merged

Conversation

najeeb-kazmi
Copy link
Member

Fixes #3849

@najeeb-kazmi najeeb-kazmi requested a review from a team as a code owner January 24, 2020 22:25
@yaeldekel
Copy link

yaeldekel commented Jan 26, 2020

public string[] AllFeatures { get; set; }

Looks like this property is duplicated in InspectedRowWithAllFeatures and in InspectedRow. #Resolved


Refers to: docs/code/MlNetCookBook.md:134 in 1e3d99d. [](commit_id = 1e3d99d, deletion_comment = False)

[Example file1](../../test/data/adult.train):
[Example file2](../../test/data/adult.test):
[Example file1](../../test/data/adult.tiny.with-schema.txt):
[Example file2](../../test/data/adult.tiny.with-schema.txt):
Copy link

@yaeldekel yaeldekel Jan 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are identical. #WontFix

Copy link
Member Author

@najeeb-kazmi najeeb-kazmi Jan 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer have adult.train and adult.test in the repo. I'm using this file twice to demonstrate how multiple files can be loaded.
I'll add a sentence saying so.


In reply to: 370990390 [](ancestors = 370990390)

-0.61,-0.37,-0.12,0.55,-1.00,0.84,-0.02,1.30,-0.24,-0.50,-2.12,148.12
-0.85,-0.91,1.81,0.02,-0.78,-1.41,-1.09,-0.65,0.90,-0.37,-0.22,402.20
0.28,1.05,-0.24,0.30,-0.99,0.19,0.32,-0.95,-1.19,-0.63,0.75,443.51
-2.75;0.77;-0.61;0.14;1.39;0.38;-0.53;-0.50;-2.13;-0.39;0.46;140.66
Copy link

@yaeldekel yaeldekel Jan 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; [](start = 5, length = 1)

Nit: Why are you changing the commas to semicolons?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now I see that semicolon is actually the separator in this dataset. Should we change it to .txt instead of .csv?


In reply to: 370990496 [](ancestors = 370990496)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't touch this right now, with all the issues we are seeing with tests failing randomly.


In reply to: 370990675 [](ancestors = 370990675,370990496)


For example, if the linear model assigned zero weight to a feature that we consider important, it could indicate some problem with modeling. The weights of the linear model can also be used as a poor man's estimation of 'feature importance'.

We provide a set of `onFit` delegates that allow introspection of the individual transformers as they are trained.
We provide a set of `onFit` delegates that allow inspection of the individual transformers as they are trained.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onFit [](start = 21, length = 5)

This is mentioned here, but I don't see anywhere in this file that shows how to use it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really relevant to model coefficients. I will add another section for this.


In reply to: 370991105 [](ancestors = 370991105)

@codecov
Copy link

codecov bot commented Jan 27, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@05f89e3). Click here to learn what that means.
The diff coverage is 95.13%.

@@            Coverage Diff            @@
##             master    #4706   +/-   ##
=========================================
  Coverage          ?   75.68%           
=========================================
  Files             ?      971           
  Lines             ?   175586           
  Branches          ?    18892           
=========================================
  Hits              ?   132900           
  Misses            ?    37474           
  Partials          ?     5212
Flag Coverage Δ
#Debug 75.68% <95.13%> (?)
#production 71.23% <81.81%> (?)
#test 90.63% <99.29%> (?)
Impacted Files Coverage Δ
...Microsoft.ML.Tests/Transformers/NormalizerTests.cs 100% <ø> (ø)
src/Microsoft.ML.Data/Evaluators/EvaluatorBase.cs 54.25% <ø> (ø)
test/Microsoft.ML.TimeSeries.Tests/TimeSeries.cs 87.85% <ø> (ø)
...crosoft.ML.TimeSeries.Tests/TimeSeriesDirectApi.cs 99.27% <ø> (ø)
src/Microsoft.ML.Data/Training/TrainerUtils.cs 66.26% <ø> (ø)
src/Microsoft.ML.Data/Data/RowCursorUtils.cs 74.58% <ø> (ø)
...est/Microsoft.ML.Tests/FeatureContributionTests.cs 98.55% <ø> (ø)
...ML.Tests/Scenarios/IrisPlantClassificationTests.cs 100% <ø> (ø)
...ests/TrainerEstimators/MatrixFactorizationTests.cs 97.84% <ø> (ø)
src/Microsoft.ML.Data/Transforms/TransformBase.cs 56.05% <ø> (ø)
... and 23 more

@@ -306,6 +311,45 @@ var someRows = mlContext
var featureColumns = transformedData.GetColumn<string[]>(transformedData.Schema["AllFeatures"])

```
## How do I look at intermediate transformers as they are trained?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following code snippet is lifted verbatim from docs/samples/Microsoft.ML.Samples/Dynamic/WithOnFitDelegate.cs

@najeeb-kazmi najeeb-kazmi merged commit 7db00a1 into dotnet:master Feb 5, 2020
@najeeb-kazmi najeeb-kazmi deleted the 3849 branch February 10, 2020 21:31
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MlNetCookBook is not up to date with latest API
3 participants