Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
esde
machine-learning
MLAir
Commits
faf3c2c6
Commit
faf3c2c6
authored
3 years ago
by
v.gramlich1
Browse files
Options
Downloads
Patches
Plain Diff
Trying to make bins and rates_cap more flexible, inserting default values.
parent
f54a7b87
No related branches found
No related tags found
1 merge request
!302
Draft: Resolve "Class-based Oversampling technique"
Pipeline
#70746
failed
3 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mlair/configuration/defaults.py
+3
-0
3 additions, 0 deletions
mlair/configuration/defaults.py
mlair/run_modules/experiment_setup.py
+6
-1
6 additions, 1 deletion
mlair/run_modules/experiment_setup.py
mlair/run_modules/pre_processing.py
+3
-1
3 additions, 1 deletion
mlair/run_modules/pre_processing.py
with
12 additions
and
2 deletions
mlair/configuration/defaults.py
+
3
−
0
View file @
faf3c2c6
...
...
@@ -56,6 +56,9 @@ DEFAULT_DATA_ORIGIN = {"cloudcover": "REA", "humidity": "REA", "pblheight": "REA
DEFAULT_USE_MULTIPROCESSING
=
True
DEFAULT_USE_MULTIPROCESSING_ON_DEBUG
=
False
DEFAULT_BINS
=
10
DEFAULT_RATES_CAP
=
20
def
get_defaults
():
"""
Return all default parameters set in defaults.py
"""
...
...
This diff is collapsed.
Click to expand it.
mlair/run_modules/experiment_setup.py
+
6
−
1
View file @
faf3c2c6
...
...
@@ -215,7 +215,8 @@ class ExperimentSetup(RunEnvironment):
create_new_bootstraps
=
None
,
data_path
:
str
=
None
,
batch_path
:
str
=
None
,
login_nodes
=
None
,
hpc_hosts
=
None
,
model
=
None
,
batch_size
=
None
,
epochs
=
None
,
data_handler
=
None
,
data_origin
:
Dict
=
None
,
competitors
:
list
=
None
,
competitor_path
:
str
=
None
,
use_multiprocessing
:
bool
=
None
,
use_multiprocessing_on_debug
:
bool
=
None
,
**
kwargs
):
use_multiprocessing
:
bool
=
None
,
use_multiprocessing_on_debug
:
bool
=
None
,
bins
=
None
,
rates_cap
=
None
,
**
kwargs
):
# create run framework
super
().
__init__
()
...
...
@@ -360,6 +361,10 @@ class ExperimentSetup(RunEnvironment):
# set model architecture class
self
.
_set_param
(
"
model_class
"
,
model
,
VanillaModel
)
# set params for oversampling
self
.
_set_param
(
"
bins
"
,
bins
,
default
=
DEFAULT_BINS
)
self
.
_set_param
(
"
rates_cap
"
,
rates_cap
,
default
=
DEFAULT_RATES_CAP
)
# set remaining kwargs
if
len
(
kwargs
)
>
0
:
for
k
,
v
in
kwargs
.
items
():
...
...
This diff is collapsed.
Click to expand it.
mlair/run_modules/pre_processing.py
+
3
−
1
View file @
faf3c2c6
...
...
@@ -71,9 +71,11 @@ class PreProcessing(RunEnvironment):
self
.
report_pre_processing
()
self
.
prepare_competitors
()
def
apply_oversampling
(
self
,
bins
=
10
,
rates_cap
=
20
):
def
apply_oversampling
(
self
):
#if request for oversampling=True/False
data
=
self
.
data_store
.
get
(
'
data_collection
'
,
'
train
'
)
bins
=
self
.
data_store
.
get_default
(
'
bins
'
)
rates_cap
=
self
.
data_store
.
get_default
(
'
rates_cap
'
)
histogram
=
np
.
array
(
bins
)
#get min and max of the whole data
total_min
=
0
...
...
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