modelfoxdotdev / modelfox

ModelFox makes it easy to train, deploy, and monitor machine learning models.
Other
1.47k stars 64 forks source link

Feature importance #76

Closed m-kru closed 2 years ago

m-kru commented 2 years ago

How is feature importance actually calculated/measured?

isabella commented 2 years ago

Hi @m-kru, we have two "feature importance" merics. The first, is the one you see on the overview page. For linear models, this is calculated by taking the absolute value of the feature weight. For Gradient Boosted Decision Trees, this is calculated by counting the number of times a feature was used in all of the trees as a branching criteria. https://github.com/tangramdotdev/tangram/blob/a3f076eb176953f5377c1c9b0d0f5fa97318b9a1/crates/tree/compute_feature_importances.rs#L6

The other "feature importance", is on the predict page and shows how each feature contributed to the particular prediction. These feature contributions are calculated using shapley values https://proceedings.neurips.cc/paper/2017/file/8a20a8621978632d76c43dfd28b67767-Paper.pdf.