Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bolsonaro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luc Giffon
bolsonaro
Merge requests
!11
Resolve "Correction of multiclass classif"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Correction of multiclass classif"
14-correction-of-multiclass-classif
into
12-experiment-pipeline
Overview
1
Commits
1
Pipelines
0
Changes
16
Merged
Leo Bouscarrat
requested to merge
14-correction-of-multiclass-classif
into
12-experiment-pipeline
5 years ago
Overview
1
Commits
1
Pipelines
0
Changes
16
Expand
Closes
#14 (closed)
Edited
5 years ago
by
Charly Lamothe
0
0
Merge request reports
Compare
12-experiment-pipeline
12-experiment-pipeline (base)
and
latest version
latest version
1379c412
1 commit,
5 years ago
16 files
+
88
−
58
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
16
Search (e.g. *.vue) (Ctrl+P)
code/bolsonaro/models/omp_forest.py
+
2
−
1
Options
@@ -24,6 +24,7 @@ class OmpForest(BaseEstimator, metaclass=ABCMeta):
return
self
.
_base_forest_estimator
.
score
(
X
,
y
)
def
_base_estimator_predictions
(
self
,
X
):
# We need to use predict_proba to get the probabilities of each class
return
np
.
array
([
tree
.
predict
(
X
)
for
tree
in
self
.
_base_forest_estimator
.
estimators_
]).
T
@property
@@ -66,7 +67,7 @@ class OmpForest(BaseEstimator, metaclass=ABCMeta):
if
normalize_weights
:
# we can normalize weights (by their sum) so that they sum to 1
# and they can be interpreted as impact percentages for interpretability.
# this necessits to remove the (-) in weights, e.g. move it to the predictions (use unsigned_coef)
# this necessits to remove the (-) in weights, e.g. move it to the predictions (use unsigned_coef)
--> I don't see why
# question: je comprend pas le truc avec nonszero?
# predictions = self._omp.predict(forest_predictions) * (1 / (np.sum(self._omp.coef_) / len(np.nonzero(self._omp.coef_))))
Loading