-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add a sample for Permutation Feature Importance #1728
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
Conversation
4c82069
to
e1a5d3a
Compare
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Outdated
Show resolved
Hide resolved
Co-Authored-By: rogancarr <[email protected]>
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/PermutationFeatureImportance.cs
Outdated
Show resolved
Hide resolved
var weights = GetLinearModelWeights(linearPredictor.Model); | ||
|
||
// Compute the permutation metrics using the properly-featurized data. | ||
var transformedData = fitPipeline.Transform(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It implies that feature name can't not be identical to predicted label/score name produced by the linear model. Could you make a note here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PFI
calculation actually does its own scoring, and should do this. I actually just do this to produce the Features
column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just some minor comments.
This PR adds a sample for using
PermutationFeatureImportance
.The sample looks at the feature importances for a linear model predicting housing prices with the
HousingRegression
dataset and shows how to interpret the output ofPermutationFeatureImportance
as a measure of global feature importance.Fixes #1723