Skip to content
Snippets Groups Projects
Commit bbfd5353 authored by Baptiste Bauvin's avatar Baptiste Bauvin
Browse files

Slight mods

parent e0e15256
No related branches found
No related tags found
No related merge requests found
Pipeline #6405 failed
...@@ -215,7 +215,7 @@ def get_hyper_params(classifier_module, search_method, classifier_module_name, ...@@ -215,7 +215,7 @@ def get_hyper_params(classifier_module, search_method, classifier_module_name,
random_state=random_state, random_state=random_state,
framework="monoview", n_jobs=nb_cores, framework="monoview", n_jobs=nb_cores,
**hps_kwargs) **hps_kwargs)
hps.fit(X_train, y_train, **kwargs[classifier_module_name]) hps.fit(X_train, y_train)
cl_kwargs = hps.get_best_params() cl_kwargs = hps.get_best_params()
hps.gen_report(output_file_name) hps.gen_report(output_file_name)
logging.info("Done:\t " + search_method + " best settings") logging.info("Done:\t " + search_method + " best settings")
......
...@@ -265,9 +265,9 @@ def exec_multiview(directory, dataset_var, name, classification_indices, ...@@ -265,9 +265,9 @@ def exec_multiview(directory, dataset_var, name, classification_indices,
classifier_module = getattr(multiview_classifiers, cl_type) classifier_module = getattr(multiview_classifiers, cl_type)
classifier_name = classifier_module.classifier_class_name classifier_name = classifier_module.classifier_class_name
# classifierClass = getattr(classifierModule, CL_type + "Class") # classifierClass = getattr(classifierModule, CL_type + "Class")
logging.debug("Done:\t Getting classifiers modules") logging.info("Done:\t Getting classifiers modules")
logging.debug("Start:\t Optimizing hyperparameters") logging.info("Start:\t Optimizing hyperparameters")
hps_beg = time.monotonic() hps_beg = time.monotonic()
if hps_method != "None": if hps_method != "None":
hps_method_class = getattr(hyper_parameter_search, hps_method) hps_method_class = getattr(hyper_parameter_search, hps_method)
...@@ -298,16 +298,16 @@ def exec_multiview(directory, dataset_var, name, classification_indices, ...@@ -298,16 +298,16 @@ def exec_multiview(directory, dataset_var, name, classification_indices,
**classifier_config), **classifier_config),
random_state, multiview=True, random_state, multiview=True,
y=dataset_var.get_labels()) y=dataset_var.get_labels())
logging.debug("Done:\t Optimizing hyperparameters") logging.info("Done:\t Optimizing hyperparameters")
logging.debug("Start:\t Fitting classifier") logging.info("Start:\t Fitting classifier")
fit_beg = time.monotonic() fit_beg = time.monotonic()
classifier.fit(dataset_var, dataset_var.get_labels(), classifier.fit(dataset_var, dataset_var.get_labels(),
train_indices=learning_indices, train_indices=learning_indices,
view_indices=views_indices) view_indices=views_indices)
fit_duration = time.monotonic() - fit_beg fit_duration = time.monotonic() - fit_beg
logging.debug("Done:\t Fitting classifier") logging.info("Done:\t Fitting classifier")
logging.debug("Start:\t Predicting") logging.info("Start:\t Predicting")
train_pred = classifier.predict(dataset_var, train_pred = classifier.predict(dataset_var,
sample_indices=learning_indices, sample_indices=learning_indices,
view_indices=views_indices) view_indices=views_indices)
...@@ -349,10 +349,10 @@ def exec_multiview(directory, dataset_var, name, classification_indices, ...@@ -349,10 +349,10 @@ def exec_multiview(directory, dataset_var, name, classification_indices,
confusion_matrix = result_analyzer.analyze() confusion_matrix = result_analyzer.analyze()
logging.info("Done:\t Result Analysis for " + cl_type) logging.info("Done:\t Result Analysis for " + cl_type)
logging.debug("Start:\t Saving preds") logging.info("Start:\t Saving preds")
save_results(string_analysis, images_analysis, output_file_name, save_results(string_analysis, images_analysis, output_file_name,
confusion_matrix) confusion_matrix)
logging.debug("Start:\t Saving preds") logging.info("Start:\t Saving preds")
return MultiviewResult(cl_type, classifier_config, metrics_scores, return MultiviewResult(cl_type, classifier_config, metrics_scores,
full_pred, hps_duration, fit_duration, full_pred, hps_duration, fit_duration,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment