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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Baptiste Bauvin
Supervised MultiModal Integration Tool
Commits
2bc5e81a
Unverified
Commit
2bc5e81a
authored
3 months ago
by
Dominique Benielli
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Update base.py
parent
2a325003
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
summit/multiview_platform/utils/base.py
+7
-7
7 additions, 7 deletions
summit/multiview_platform/utils/base.py
with
7 additions
and
7 deletions
summit/multiview_platform/utils/base.py
+
7
−
7
View file @
2bc5e81a
...
@@ -65,24 +65,24 @@ class BaseClassifier(BaseEstimator, ):
...
@@ -65,24 +65,24 @@ class BaseClassifier(BaseEstimator, ):
else
:
else
:
return
self
.
__class__
.
__name__
+
"
with no config.
"
return
self
.
__class__
.
__name__
+
"
with no config.
"
def
get_base_estimator
(
self
,
base_
estimator
,
estimator_config
):
def
get_base_estimator
(
self
,
estimator
,
estimator_config
):
if
estimator_config
is
None
:
if
estimator_config
is
None
:
estimator_config
=
{}
estimator_config
=
{}
if
base_estimator
is
None
:
if
base_estimator
is
None
:
return
DecisionTreeClassifier
(
**
estimator_config
)
return
DecisionTreeClassifier
(
**
estimator_config
)
if
isinstance
(
base_
estimator
,
str
):
# pragma: no cover
if
isinstance
(
estimator
,
str
):
# pragma: no cover
if
base_
estimator
==
"
DecisionTreeClassifier
"
:
if
estimator
==
"
DecisionTreeClassifier
"
:
return
DecisionTreeClassifier
(
**
estimator_config
)
return
DecisionTreeClassifier
(
**
estimator_config
)
elif
base_
estimator
==
"
AdaboostClassifier
"
:
elif
estimator
==
"
AdaboostClassifier
"
:
return
AdaBoostClassifier
(
**
estimator_config
)
return
AdaBoostClassifier
(
**
estimator_config
)
elif
base_
estimator
==
"
RandomForestClassifier
"
:
elif
estimator
==
"
RandomForestClassifier
"
:
return
RandomForestClassifier
(
**
estimator_config
)
return
RandomForestClassifier
(
**
estimator_config
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
'
Base estimator string {} does not match an available classifier.
'
.
format
(
'
Base estimator string {} does not match an available classifier.
'
.
format
(
base_estimator
))
base_estimator
))
elif
isinstance
(
base_
estimator
,
BaseEstimator
):
elif
isinstance
(
estimator
,
BaseEstimator
):
return
base_
estimator
.
set_params
(
**
estimator_config
)
return
estimator
.
set_params
(
**
estimator_config
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
'
base_estimator must be either a string or a BaseEstimator child class, it is {}
'
.
format
(
'
base_estimator must be either a string or a BaseEstimator child class, it is {}
'
.
format
(
...
...
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