Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes error in handling #34

Merged
merged 3 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions talos/parameters/handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def run_param_pick(self):
_choice = random.choice(self.param_log)

elif self.search_method == 'linear':
_choice = self.param_log.min()
_choice = min(self.param_log)

elif self.search_method == 'reverse':
_choice = self.param_log.max()
_choice = max(self.param_log)

self.param_log.remove(_choice)

Expand Down
17 changes: 15 additions & 2 deletions test/core_tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,28 @@ class TestCancer:

def __init__(self):
self.x, self.y = datasets.cervical_cancer()
self.model = cervix_model

def test_scan_cancer(self):
print("Running Cervical Cancer dataset test...")
Scan(self.x, self.y, grid_downsample=0.001, params=p3,
Scan(self.x, self.y, grid_downsample=0.0005, params=p3,
dataset_name='testing', experiment_no='a',
model=cervix_model,
model=self.model,
reduction_method='spear', reduction_interval=5)
Reporting('testing_a.csv')

def test_linear_method(self):
print("Testing linear method on Cancer dataset...")
Scan(self.x, self.y, params=p3, dataset_name='testing',
search_method='linear', grid_downsample=0.0005,
experiment_no='000', model=self.model)

def test_reverse_method(self):
print("Testing reverse method on Cancer dataset...")
Scan(self.x, self.y, params=p3, dataset_name='testing',
search_method='reverse', grid_downsample=0.0005,
experiment_no='000', model=self.model)


class TestLoadDatasets:

Expand Down
2 changes: 2 additions & 0 deletions test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
if __name__ == '__main__':

# TODO describe what all this does
TestCancer().test_linear_method()
TestCancer().test_reverse_method()
TestIris().test_scan_iris_explicit_validation_set()
TestIris().test_scan_iris_explicit_validation_set_force_fail()
TestIris().test_scan_iris_1()
Expand Down