Skip to content
Snippets Groups Projects
Commit faf3c2c6 authored by v.gramlich1's avatar v.gramlich1
Browse files

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!302Draft: Resolve "Class-based Oversampling technique"
Pipeline #70746 failed
......@@ -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"""
......
......@@ -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():
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment