0
$\begingroup$

I've been playing around with bagged trees and random forests. How can I tell what factors most influenced the categorization? Will scikitlearn just spit it out, or is it trickier than that?

$\endgroup$

1 Answer 1

0
$\begingroup$

It basically lies within the fitted object.

model.fit(X, y)
importances = model.feature_importances_

The importances are in the same order as the columns of features ($X$).

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.