diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b7b3821..0188e16 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,22 +2,12 @@ - - - - - - - - - - - - - - - + + + + + - + - + @@ -173,16 +163,16 @@ + - + - @@ -211,7 +201,7 @@ - + @@ -235,7 +225,7 @@ - + diff --git a/env/default_values.toml b/env/default_values.toml index 618eb45..877848a 100644 --- a/env/default_values.toml +++ b/env/default_values.toml @@ -10,7 +10,7 @@ gamma = 0.85 alpha = 7 [iim] -neighbor = 10 +learning_neighbors = 10 algorithm_code = "iim 2" [mrnn] diff --git a/imputegap/imputation/__pycache__/imputation.cpython-312.pyc b/imputegap/imputation/__pycache__/imputation.cpython-312.pyc index 9bc19cb..734397f 100644 Binary files a/imputegap/imputation/__pycache__/imputation.cpython-312.pyc and b/imputegap/imputation/__pycache__/imputation.cpython-312.pyc differ diff --git a/imputegap/imputation/imputation.py b/imputegap/imputation/imputation.py index 79603de..727ddb8 100644 --- a/imputegap/imputation/imputation.py +++ b/imputegap/imputation/imputation.py @@ -32,7 +32,7 @@ def load_parameters(query="default", algorithm="cdrec"): if not os.path.exists(filepath): filepath = filepath[:1] - with open(filepath, "r") as file: + with open(filepath, "r") as _: config = toml.load(filepath) params = None @@ -47,9 +47,9 @@ def load_parameters(query="default", algorithm="cdrec"): alpha = int(config['stmvl']['alpha']) params = (window_size, gamma, alpha) elif algorithm == "iim": - neighbors = int(config['iim']['neighbor']) + learning_neighbors = int(config['iim']['learning_neighbors']) algo_code = config['iim']['algorithm_code'] - params = (neighbors, algo_code) + params = (learning_neighbors, algo_code) elif algorithm == "mrnn": hidden_dim = int(config['mrnn']['hidden_dim']) learning_rate = float(config['mrnn']['learning_rate']) diff --git a/imputegap/optimization/__pycache__/algorithm_parameters.cpython-312.pyc b/imputegap/optimization/__pycache__/algorithm_parameters.cpython-312.pyc index 2d874f2..72f742a 100644 Binary files a/imputegap/optimization/__pycache__/algorithm_parameters.cpython-312.pyc and b/imputegap/optimization/__pycache__/algorithm_parameters.cpython-312.pyc differ diff --git a/imputegap/optimization/algorithm_parameters.py b/imputegap/optimization/algorithm_parameters.py index 7fb8cf1..f186373 100644 --- a/imputegap/optimization/algorithm_parameters.py +++ b/imputegap/optimization/algorithm_parameters.py @@ -42,7 +42,7 @@ # Define the parameter names for each algorithm PARAM_NAMES = { 'cdrec': ['rank', 'epsilon', 'iteration'], - 'iim': ['neighbor'], + 'iim': ['learning_neighbors'], 'mrnn': ['hidden_dim', 'learning_rate', 'iterations', 'seq_len' ], 'stmvl': ['window_size', 'gamma', 'alpha'] } diff --git a/requirements.txt b/requirements.txt index a873ff3..1c9e028 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy==1.13.3 +numpy==1.21.5 pandas==2.0.3 matplotlib==3.7.5 toml==0.10.2 diff --git a/tests/__pycache__/test_opti_bayesian_iim.cpython-312.pyc b/tests/__pycache__/test_opti_bayesian_iim.cpython-312.pyc index efdcba2..f189be8 100644 Binary files a/tests/__pycache__/test_opti_bayesian_iim.cpython-312.pyc and b/tests/__pycache__/test_opti_bayesian_iim.cpython-312.pyc differ diff --git a/tests/test_opti_bayesian_iim.py b/tests/test_opti_bayesian_iim.py index 69639c0..2d49dcd 100644 --- a/tests/test_opti_bayesian_iim.py +++ b/tests/test_opti_bayesian_iim.py @@ -55,8 +55,7 @@ def test_optimization_bayesian_stmvl(self): params = Imputation.load_parameters(query="default", algorithm=algorithm) params_optimal = (optimal_params['neighbor'], "iim 2") - _, metrics_optimal = Imputation.Regression.iim_imputation(ground_truth=gap.ts, contamination=ts_contaminated, - params=params_optimal) + _, metrics_optimal = Imputation.Regression.iim_imputation(ground_truth=gap.ts, contamination=ts_contaminated, params=params_optimal) _, metrics_default = Imputation.Regression.iim_imputation(ground_truth=gap.ts, contamination=ts_contaminated, params=params) Optimization.save_optimization(optimal_params=optimal_params, algorithm=algorithm+"_test")