MCPcopy Create free account
hub / github.com/antlr/codebuff / print_importances

Function print_importances

python/src/groomlib.py:194–200  ·  view source on GitHub ↗
(forest, feature_names, n=10)

Source from the content-addressed store, hash-verified

192
193
194def print_importances(forest, feature_names, n=10):
195 importances = forest.feature_importances_
196 indices = np.argsort(importances)[::-1]
197 dims = len(feature_names)
198 for f in range(0,dims if dims<n else n):
199 print("%d. feature %30s (%f)" %
200 (f + 1, feature_names[indices[f]], importances[indices[f]]))

Callers 1

groom.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected