Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Supervised MultiModal Integration Tool
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
Analyze
Contributor 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
Baptiste Bauvin
Supervised MultiModal Integration Tool
Commits
d2326aa7
Commit
d2326aa7
authored
2 years ago
by
Baptiste Bauvin
Browse files
Options
Downloads
Patches
Plain Diff
Feat_imp_works with nans
parent
279c4c8e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#11528
failed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
summit/multiview_platform/monoview_classifiers/ib_svm_rbf.py
+2
-1
2 additions, 1 deletion
summit/multiview_platform/monoview_classifiers/ib_svm_rbf.py
summit/multiview_platform/monoview_classifiers/random_foscm.py
+45
-0
45 additions, 0 deletions
...t/multiview_platform/monoview_classifiers/random_foscm.py
with
47 additions
and
1 deletion
summit/multiview_platform/monoview_classifiers/ib_svm_rbf.py
+
2
−
1
View file @
d2326aa7
...
@@ -32,7 +32,8 @@ class IBSVMRBF(BaseMonoviewClassifier, BalancedBaggingClassifier):
...
@@ -32,7 +32,8 @@ class IBSVMRBF(BaseMonoviewClassifier, BalancedBaggingClassifier):
for
estim
in
self
.
estimators_
:
for
estim
in
self
.
estimators_
:
if
hasattr
(
estim
[
'
classifier
'
],
'
feature_importances_
'
):
if
hasattr
(
estim
[
'
classifier
'
],
'
feature_importances_
'
):
self
.
feature_importances_
+=
estim
[
'
classifier
'
].
feature_importances_
self
.
feature_importances_
+=
estim
[
'
classifier
'
].
feature_importances_
self
.
feature_importances_
/=
np
.
sum
(
self
.
feature_importances_
)
if
np
.
sum
(
self
.
feature_importances_
)
!=
0
:
self
.
feature_importances_
/=
np
.
sum
(
self
.
feature_importances_
)
return
self
return
self
...
...
This diff is collapsed.
Click to expand it.
summit/multiview_platform/monoview_classifiers/random_foscm.py
0 → 100644
+
45
−
0
View file @
d2326aa7
from
sklearn.ensemble
import
RandomForestClassifier
from
..monoview.monoview_utils
import
BaseMonoviewClassifier
from
summit.multiview_platform.utils.hyper_parameter_search
import
CustomRandint
# Author-Info
__author__
=
"
Baptiste Bauvin
"
__status__
=
"
Prototype
"
# Production, Development, Prototype
classifier_class_name
=
"
RandomForest
"
class
RandomForest
(
RandomForestClassifier
,
BaseMonoviewClassifier
):
"""
This class is an adaptation of scikit-learn
'
s `RandomForestClassifier <https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html>`_
"""
def
__init__
(
self
,
random_state
=
None
,
n_estimators
=
10
,
max_depth
=
None
,
criterion
=
'
gini
'
,
**
kwargs
):
RandomForestClassifier
.
__init__
(
self
,
n_estimators
=
n_estimators
,
max_depth
=
max_depth
,
criterion
=
criterion
,
class_weight
=
"
balanced
"
,
random_state
=
random_state
)
self
.
param_names
=
[
"
n_estimators
"
,
"
max_depth
"
,
"
criterion
"
,
"
random_state
"
]
self
.
classed_params
=
[]
self
.
distribs
=
[
CustomRandint
(
low
=
1
,
high
=
300
),
CustomRandint
(
low
=
1
,
high
=
10
),
[
"
gini
"
,
"
entropy
"
],
[
random_state
]]
self
.
weird_strings
=
{}
def
get_interpretation
(
self
,
directory
,
base_file_name
,
y_test
,
feature_ids
,
multiclass
=
False
):
interpret_string
=
""
interpret_string
+=
self
.
get_feature_importance
(
directory
,
base_file_name
,
feature_ids
)
return
interpret_string
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment