Skip to content
Snippets Groups Projects

WIP: Resolve "Adding new datasets"

Merged Charly Lamothe requested to merge 17-adding-new-datasets into master
Files
8
@@ -134,16 +134,13 @@ class SingleOmpForest(OmpForest):
Make all the base tree predictions
:param X: a Forest
:return: a np.array of the predictions of the entire forest
:return: a np.array of the predictions of the trees selected by OMP without applyong the weight
"""
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