From 0f1d25f74fd5f116eceee94c2c6e7b2c998b5d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Bouscarrat?= <leo.bouscarrat@euranova.eu> Date: Fri, 6 Mar 2020 00:12:39 +0100 Subject: [PATCH] Adding one [0] after nonzero --- code/bolsonaro/models/omp_forest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/bolsonaro/models/omp_forest.py b/code/bolsonaro/models/omp_forest.py index 5b211b0..5b947d3 100644 --- a/code/bolsonaro/models/omp_forest.py +++ b/code/bolsonaro/models/omp_forest.py @@ -142,8 +142,8 @@ class SingleOmpForest(OmpForest): forest_predictions /= self._forest_norms weights = self._omp.coef_ - omp_trees_indices = np.nonzero(weights) + omp_trees_indices = np.nonzero(weights)[0] select_trees = np.mean(forest_predictions[omp_trees_indices], axis=0) - + print(len(omp_trees_indices)) return select_trees -- GitLab