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
846084bb
Commit
846084bb
authored
3 years ago
by
Florence
Browse files
Options
Downloads
Patches
Plain Diff
New imbalance_bagging.py
parent
9a38aef0
Branches
Branches containing commit
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/monoview_classifiers/imbalance_bagging.py
+31
-0
31 additions, 0 deletions
...tiview_platform/monoview_classifiers/imbalance_bagging.py
with
31 additions
and
0 deletions
summit/multiview_platform/monoview_classifiers/imbalance_bagging.py
0 → 100644
+
31
−
0
View file @
846084bb
from
imblearn.ensemble
import
BalancedBaggingClassifier
from
sklearn.tree
import
DecisionTreeClassifier
from
..monoview.monoview_utils
import
BaseMonoviewClassifier
from
..utils.base
import
base_boosting_estimators
from
..utils.hyper_parameter_search
import
CustomRandint
,
CustomUniform
classifier_class_name
=
"
ImbalanceBagging
"
class
ImbalanceBagging
(
BaseMonoviewClassifier
,
BalancedBaggingClassifier
):
def
__init__
(
self
,
random_state
=
None
,
base_estimator
=
"
DecisionTreeClassifier
"
,
n_estimators
=
10
,
sampling_strategy
=
"
auto
"
,
replacement
=
False
,
base_estimator_config
=
None
):
base_estimator
=
self
.
get_base_estimator
(
base_estimator
,
base_estimator_config
)
super
(
ImbalanceBagging
,
self
).
__init__
(
random_state
=
random_state
,
base_estimator
=
base_estimator
,
n_estimators
=
n_estimators
,
sampling_strategy
=
sampling_strategy
,
replacement
=
replacement
)
self
.
param_names
=
[
"
n_estimators
"
,
"
base_estimator
"
,
"
sampling_strategy
"
,]
self
.
classed_params
=
[
"
base_estimator
"
]
self
.
distribs
=
[
CustomRandint
(
low
=
1
,
high
=
50
),
base_boosting_estimators
,
[
"
auto
"
]]
self
.
weird_strings
=
{
"
base_estimator
"
:
"
class_name
"
}
self
.
base_estimator_config
=
base_estimator_config
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