To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit e6017703 authored by Feliks Kiszkurno's avatar Feliks Kiszkurno
Browse files

bug fixes, setup

parent ffe7438e
......@@ -21,11 +21,11 @@ from datetime import datetime
settings.init()
# Config
create_new_data = True # set to True if you need to reassign the classes
create_new_data = False # set to True if you need to reassign the classes
invert_existing_data = False # invert existing measurements
create_new_data_only = True # set to False in order to run ML classifications
create_new_data_only = False # set to False in order to run ML classifications
reassign_classes = False; class_type = 'norm'
param_path = os.path.abspath(os.path.join(os.getcwd()) + '/' + 'TestDefinitions/sen_study2.csv')
param_path = os.path.abspath(os.path.join(os.getcwd()) + '/' + 'TestDefinitions/hor1__final_500_50.csv')
test_definitions.init(path=param_path)
# Load existing data instead of creating new one.
......
......@@ -30,7 +30,7 @@ def init():
settings['log_file_name'] = datetime.now().strftime("%d_%m_%Y_%H_%M_%S")
# Training and prediction split
settings['split_proportion'] = 0.75 # Part of available profiles that will be used for prediction
settings['split_proportion'] = 0.5 # Part of available profiles that will be used for prediction
settings['data_split'] = 'predefined' # 'random' or 'predefined'
settings['use_batches'] = True # True or False
if settings['use_batches'] is True:
......@@ -44,7 +44,9 @@ def init():
settings['clf_trained'] = []
# Interpolate results to grid inside create_data script
settings['grd'] = True
settings['weight'] = True
# Sample weight
settings['weight'] = False
# Parameters for resampling
settings['resample'] = False
......@@ -52,12 +54,12 @@ def init():
settings['resample_y_spacing'] = 1
# Reduce sample population
settings['reduce_samples'] = True
settings['reduce_samples'] = False
settings['reduce_samples_factor'] = 0.25
# Normalization and classes
settings['norm_class'] = True # True to use normalized classes, False to use class_ids
settings['norm_class_num'] = 5 # Number of classes for normalized data
settings['norm_class_num'] = 2 # Number of classes for normalized data
settings['norm'] = True # True to use normalized data, False to use raw data
settings['use_labels'] = False # True to use labels instead of classes
......@@ -71,7 +73,7 @@ def init():
settings['sen'] = True # True - include sensitivity, False - ignore sensitivity
# Include depth
settings['depth'] = False # True - include depth, False - ignore depth
settings['depth'] = True # True - include depth, False - ignore depth
# Borehole simulation
settings['sim_bh'] = True
......@@ -79,10 +81,10 @@ def init():
2: {'x_start': 0, 'x_end': 2, 'y_start': -18, 'y_end': 0}}
# Balance classes
settings['balance'] = True
settings['balance'] = False
# Classifiers
settings['optimize_ml'] = False # True - performs hyperparameter search
settings['optimize_ml'] = True # True - performs hyperparameter search
settings['optimize_ml_type'] = 'exhaustive' # Type of grid search exhaustive or halved
# Plots
......
......@@ -27,8 +27,8 @@ def svm_run(test_results, random_seed):
if settings.settings['optimize_ml'] is True:
hyperparameters = {'C': list(np.argmin(0.5, 1.5, 0.1)),
'kernel': ['linear', 'rbf', 'poly', 'sigmoid', 'precomputed'],
hyperparameters = {'C': list(np.arange(0.5, 1.5, 0.1)),
'kernel': ['linear', 'rbf', 'poly', 'sigmoid'],
'decision_function_shape': ['ovr', 'ovo']}
clf_base = svm.SVC()
......
......@@ -15,7 +15,7 @@ from .preprocess_data import preprocess_data
from .plot_class_res import plot_class_res
from .ask_committee import ask_committee
from .plot_class_overview import plot_class_overview
from .select_search_type import select_search_types
from .select_search_type import select_search_type
from .select_split_type import select_split_type
from .check_name import check_name
from .plot_depth_true_estim import plot_depth_true_estim
......
......@@ -13,7 +13,7 @@ from sklearn.model_selection import HalvingGridSearchCV
import settings
def select_search_types(clf_base, hyperparameters):
def select_search_type(clf_base, hyperparameters):
if settings.settings['optimize_ml_type'] is 'exhaustive':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment