Model Pipeline - Feature importance explanation
This pipeline shows how a machine learning model learns from data and how we find out which features are most important for its decisions.
This pipeline shows how a machine learning model learns from data and how we find out which features are most important for its decisions.
Loss
0.7 |****
0.6 |***
0.5 |**
0.4 |**
0.3 |*
0.2 |*
+-----
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.65 | 0.60 | Model starts learning, accuracy is low |
| 2 | 0.45 | 0.75 | Loss decreases, accuracy improves |
| 3 | 0.35 | 0.82 | Model learns important patterns |
| 4 | 0.28 | 0.88 | Accuracy continues to increase |
| 5 | 0.25 | 0.92 | Model converges with good accuracy |
feature importance tell us in a machine learning model?feature_importances_ with an 's' and underscore at the end.from sklearn.ensemble import RandomForestClassifier X = [[1, 2], [3, 4], [5, 6], [7, 8]] y = [0, 1, 0, 1] model = RandomForestClassifier(random_state=0) model.fit(X, y) importances = model.feature_importances_ print(importances)
from sklearn.ensemble import RandomForestClassifier model = RandomForestClassifier() model.feature_importances_
fit() before accessing feature_importances_.Pass the test and this pattern moves unknown