From 915b6bfc035a91356d0e0db0a4020a7fd17ff788 Mon Sep 17 00:00:00 2001 From: qnater Date: Fri, 27 Sep 2024 16:52:21 +0200 Subject: [PATCH] 8. adding of eeg dataset with bayesian tests --- .github/workflows/pytest_contamination.yml | 4 +++- .idea/workspace.xml | 7 ++++--- imputegap/imputation/imputation.py | 4 ++-- imputegap/runner_optimization.py | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pytest_contamination.yml b/.github/workflows/pytest_contamination.yml index 4cf4e1b..2d23d4e 100644 --- a/.github/workflows/pytest_contamination.yml +++ b/.github/workflows/pytest_contamination.yml @@ -29,4 +29,6 @@ jobs: pip install pytest - name: Run pytest - run: python -m pytest ./tests/test_contamination_mcar.py \ No newline at end of file + run: | + python -m pytest ./tests/test_contamination_mcar.py + python -m pytest ./tests/test_contamination_mp.py \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 229b852..e56397c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,10 @@ - + - + + diff --git a/imputegap/imputation/imputation.py b/imputegap/imputation/imputation.py index 14f0dc4..9d86ea5 100644 --- a/imputegap/imputation/imputation.py +++ b/imputegap/imputation/imputation.py @@ -12,7 +12,7 @@ class Imputation: - def load_parameters(query="default", algorithm="cdrec"): + def load_parameters(query: str = "default", algorithm: str = "cdrec"): """ Load default values of algorithms @@ -79,7 +79,7 @@ def evaluate_params(ground_truth, contamination, configuration, algorithm="cdrec imputation, error_measures = Imputation.MR.cdrec(ground_truth, contamination, (rank, eps, iters)) elif algorithm == 'iim': learning_neighbours = configuration - alg_code = "iim " + learning_neighbours + alg_code = "iim " + re.sub(r'[\W_]', '', str(learning_neighbours)) imputation, error_measures = Imputation.Regression.iim_imputation(ground_truth, contamination, (learning_neighbours, alg_code)) elif algorithm == 'mrnn': hidden_dim, learning_rate, iterations, keep_prob, seq_len = configuration diff --git a/imputegap/runner_optimization.py b/imputegap/runner_optimization.py index c662de5..e4fb079 100644 --- a/imputegap/runner_optimization.py +++ b/imputegap/runner_optimization.py @@ -37,7 +37,7 @@ def check_block_size(filename): gap.print() gap.plot(ts_type="contamination", title="test", save_path="assets", limitation=3, display=False) - optimal_params, yi = Optimization.Bayesian.bayesian_optimization(ground_truth=gap.ts, contamination=gap.ts_contaminate) + optimal_params, yi = Optimization.Bayesian.bayesian_optimization(ground_truth=gap.ts, contamination=gap.ts_contaminate, algorithm="iim") print("\nOptical Params : ", optimal_params) print("\nyi : ", yi, "\n")