fit method
Implementation
void fit(List<List<double>> X, List<int> y) {
final n = X.length;
final sampleSize = (n * sampleRatio).ceil();
_trees.clear();
for (var t = 0; t < nEstimators; t++) {
final sampleX = <List<double>>[];
final sampleY = <int>[];
for (var i = 0; i < sampleSize; i++) {
final idx = _rand.nextInt(n);
sampleX.add(X[idx]);
sampleY.add(y[idx]);
}
final tree = DecisionTreeClassifier(maxDepth: maxDepth);
tree.fit(sampleX, sampleY);
_trees.add(tree);
}
}