Skip to content

Add entrypoint for PFI - #4232

Merged
najeeb-kazmi merged 15 commits into
dotnet:masterfrom
najeeb-kazmi:pfi
Sep 28, 2019
Merged

najeeb-kazmi merged 15 commits into
dotnet:masterfrom
najeeb-kazmi:pfi

Conversation

@najeeb-kazmi

@najeeb-kazmi najeeb-kazmi commented Sep 20, 2019 •

Copy link
Copy Markdown
Member

Fixes #4231

Entrypoint is needed to add PFI to NimbusML
microsoft/NimbusML#92

@najeeb-kazmi
najeeb-kazmi requested a review from ganik September 20, 2019 00:00
@najeeb-kazmi
najeeb-kazmi requested a review from a team as a code owner September 20, 2019 00:00
Comment thread src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs Outdated
Comment thread src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs Outdated
Comment thread test/BaselineOutput/Common/EntryPoints/core_manifest.json
Comment thread src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs Outdated
Comment thread src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs Outdated
Comment thread src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs Outdated
@najeeb-kazmi najeeb-kazmi changed the title [WIP] Add entrypoint for PFI Add entrypoint for PFI Sep 24, 2019
Comment thread src/Microsoft.ML.Data/DataLoadSave/TransformerChain.cs Outdated
Comment thread src/Microsoft.ML.Data/DataLoadSave/TransformerChain.cs Outdated
Comment thread src/Microsoft.ML.EntryPoints/PermutationFeatureImportance.cs Outdated
Contracts.Assert(predictor != null, "No predictor found in model");
var transformedData = input.PredictorModel.TransformModel.Apply(env, input.Data);
IDataView result = PermutationFeatureImportanceUtils.GetMetrics(env, predictor, roleMappedData.Schema, transformedData, input);
return new PermutationFeatureImportanceOutput { Metrics = result };

@ganik ganik Sep 27, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome change! #Resolved

@ganik ganik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

var loadedData = mlContext.Data.LoadFromBinary(outputDataPath);
Assert.NotNull(loadedData.Schema.GetColumnOrNull("FeatureName"));
Assert.NotNull(loadedData.Schema.GetColumnOrNull("AreaUnderRocCurve"));
Assert.NotNull(loadedData.Schema.GetColumnOrNull("Accuracy"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to verify that the numbers that come back here are correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We would verify this by loading the same predictor model and data that goes into the PFI node, and applying the same steps to them that the PFI node does, so I don't see the point of doing this.

@najeeb-kazmi
najeeb-kazmi merged commit 7fd670f into dotnet:master Sep 28, 2019
PermutationFeatureImportanceArguments input)
{
var roles = roleMappedData.Schema.GetColumnRoleNames();
var featureColumnName = roles.Where(x => x.Key.Value == RoleMappedSchema.ColumnRole.Feature.Value).First().Value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

featureColumnName [](start = 16, length = 17)

All these special roles - features, label, group etc. have properties in RoleMappedSchema, but you need to check first that they are not null. (here and in the other Get***Metrics methods as well).

@najeeb-kazmi
najeeb-kazmi deleted the pfi branch January 29, 2020 23:35
@ghost ghost locked as resolved and limited conversation to collaborators Mar 20, 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.

Add Entry Point for Permutation Feature Importance

5 participants