predict method

  1. @override
int predict(
  1. List<double> X
)
override

Implementation of sklearn.ensemble.RandomForestClassifier.predict.

Implementation

@override
int predict(List<double> X) {
  var cls = List<dynamic>.filled(_dtrees[0].classes.length, 0);
  _dtrees.asMap().forEach((i, v) => cls[_dtrees[i].predict(X)]++);
  return classes[argmax(cls)];
}