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

Add a sample for Permutation Feature Importance #1728

Merged
merged 9 commits into from
Nov 28, 2018

Conversation

rogancarr
Copy link
Contributor

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 of PermutationFeatureImportance as a measure of global feature importance.

Fixes #1723

@rogancarr rogancarr changed the title Add a sample for Permutation Feature Importance WIP: Add a sample for Permutation Feature Importance Nov 27, 2018
@rogancarr rogancarr changed the title WIP: Add a sample for Permutation Feature Importance Add a sample for Permutation Feature Importance Nov 27, 2018
@rogancarr rogancarr self-assigned this Nov 27, 2018
var weights = GetLinearModelWeights(linearPredictor.Model);

// Compute the permutation metrics using the properly-featurized data.
var transformedData = fitPipeline.Transform(data);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@wschin wschin left a 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.

@wschin wschin added the documentation Related to documentation of ML.NET label Nov 28, 2018
@rogancarr rogancarr merged commit 3ff25e0 into dotnet:master Nov 28, 2018
@rogancarr rogancarr deleted the 1723_PFI_Documentation branch November 28, 2018 01:21
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Related to documentation of ML.NET
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants