Skip to content

Commit

Permalink
2. adding of eeg dataset with bayesian tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qnater committed Sep 27, 2024
1 parent 3b40dbf commit 390895d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 30 deletions.
34 changes: 12 additions & 22 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion env/default_values.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gamma = 0.85
alpha = 7

[iim]
neighbor = 10
learning_neighbors = 10
algorithm_code = "iim 2"

[mrnn]
Expand Down
Binary file modified imputegap/imputation/__pycache__/imputation.cpython-312.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions imputegap/imputation/imputation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'])
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion imputegap/optimization/algorithm_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy==1.13.3
numpy==1.21.5
pandas==2.0.3
matplotlib==3.7.5
toml==0.10.2
Expand Down
Binary file modified tests/__pycache__/test_opti_bayesian_iim.cpython-312.pyc
Binary file not shown.
3 changes: 1 addition & 2 deletions tests/test_opti_bayesian_iim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 390895d

Please sign in to comment.