healthcareai-py
healthcareai-py copied to clipboard
Trained random forest models should have a .plot_feature_importances() method
While this would benefit from #446 it could be done with a bit of hacky logic as an MVP
GWT
-
Given I am a user that has a trained random forest model
-
When I call the method
trained_rf.plot_feature_importances()
-
Then I should see the feature importance plot shown during training.
-
Given I am a user that has a trained model of any other type
-
When I call the method
trained_foo.plot_feature_importances()
-
Then I should see a warning or error message saying that this is only for random forest models
Notes
- The current implentation of
plot_rf_features_from_tsm()
requires the x_train data. This isn't something we want to store in a serialized model for PHI, data security and performance reasons. Therefore, this will require some thought and investigation. - Some possible solutions:
- Generate the plot and serialize it somehow during training as part of the
TrainedSupervisedModel
- ???
- Generate the plot and serialize it somehow during training as part of the