src.eval.rand_forest_evaluator

Classes

RandForestEvaluator(**kwargs)

class src.eval.rand_forest_evaluator.RandForestEvaluator(**kwargs)
Author:

Alberto M. Esmoris Pena

Class to evaluate trained random forest models. See RandomForestClassificationModel.

Variables:
  • num_decision_trees (int) – How many estimators consider when plotting the decision trees. Zero means none at all, n means consider n decision trees, and -1 means consider all the decision trees.

  • compute_permutation_importance – Whether to also compute the permutation importance (True) or not (False).

__init__(**kwargs)

Initialize/instantiate a RandForestEvaluator.

Parameters:

kwargs – The attributes for the RandForestEvaluator.

eval(model, X=None, y=None, **kwargs)

Evaluate a trained random forest model.

Parameters:
  • model (RandomForestClassificationModel) – The random forest model.

  • X – The matrix of point-wise features. Rows are points, columns are features.

  • y – The vector of classes. The component i represents the class for the point i.

Returns:

The evaluation of the trained random forest.

Return type:

RandForestEvaluation