Skip to content
Snippets Groups Projects

WIP: Resolve "Adding new datasets"

Merged Charly Lamothe requested to merge 17-adding-new-datasets into master
2 files
+ 3
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -136,14 +136,11 @@ class SingleOmpForest(OmpForest):
:param X: a Forest
:return: a np.array of the predictions of the entire forest
"""
forest_predictions = self._base_estimator_predictions(X).T
forest_predictions = np.array([tree.predict(X) for tree in self._base_forest_estimator.estimators_])
if self._models_parameters.normalize_D:
forest_predictions /= self._forest_norms
weights = self._omp.coef_
omp_trees_indices = np.nonzero(weights)[0]
select_trees = np.mean(forest_predictions[omp_trees_indices], axis=0)
print(len(omp_trees_indices))
select_trees = np.mean(forest_predictions[weights != 0], axis=0)
return select_trees
Loading