diff --git a/multiview-machine-learning-omis.iml b/multiview-machine-learning-omis.iml index de23ab34b807e356f1d63dd07e64d4cf1b024539..337fdd37f525439acb534fb1f76c2491701dbe2b 100644 --- a/multiview-machine-learning-omis.iml +++ b/multiview-machine-learning-omis.iml @@ -2,7 +2,6 @@ <module type="WEB_MODULE" version="4"> <component name="NewModuleRootManager"> <content url="file://$MODULE_DIR$" /> - <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="multiview_generator" /> <orderEntry type="module" module-name="short_projects" /> diff --git a/multiview_platform/examples/config_files/config_example_1.yml b/multiview_platform/examples/config_files/config_example_1.yml index a050b34a291925e6fb6116aac3290d8ac5ab434a..1b1eed075810e77a02c94c95ee37841adb88d6f8 100644 --- a/multiview_platform/examples/config_files/config_example_1.yml +++ b/multiview_platform/examples/config_files/config_example_1.yml @@ -3,15 +3,15 @@ # Enable logging log: True # The name of each dataset in the directory on which the benchmark should be run -name: ["doc_summit"] +name: ["tuto"] # A label for the resul directory -label: "example_1" +label: # The type of dataset, currently supported ".hdf5", and ".csv" file_type: ".hdf5" # The views to use in the banchmark, an empty value will result in using all the views views: # The path to the directory where the datasets are stored, an absolute path is advised -pathf: "examples/data/" +pathf: "." # The niceness of the processes, useful to lower their priority nice: 0 # The random state of the benchmark, useful for reproducibility @@ -23,7 +23,7 @@ full: True # Used to be able to run more than one benchmark per minute debug: False # The directory in which the results will be stored, an absolute path is advised -res_dir: "examples/results/example_1/" +res_dir: "." # If an error occurs in a classifier, if track_tracebacks is set to True, the # benchmark saves the traceback and continues, if it is set to False, it will # stop the benchmark and raise the error @@ -34,25 +34,23 @@ track_tracebacks: True # The ratio of test examples/number of train examples split: 0.35 # The nubmer of folds in the cross validation process when hyper-paramter optimization is performed -nb_folds: 2 +nb_folds: 5 # The number of classes to select in the dataset nb_class: # The name of the classes to select in the dataset classes: # The type of algorithms to run during the benchmark (monoview and/or multiview) -type: ["monoview","multiview"] +type: ["monoview"] # The name of the monoview algorithms to run, ["all"] to run all the available classifiers algos_monoview: ["decision_tree"] # The names of the multiview algorithms to run, ["all"] to run all the available classifiers -algos_multiview: ["weighted_linear_late_fusion",] +algos_multiview: [] # The number of times the benchamrk is repeated with different train/test # split, to have more statistically significant results -stats_iter: 1 +stats_iter: 5 # The metrics that will be use din the result analysis metrics: accuracy_score: {} - f1_score: - average: "micro" # The metric that will be used in the hyper-parameter optimization process metric_princ: "accuracy_score" # The type of hyper-parameter optimization method @@ -65,14 +63,3 @@ hps_args: {} decision_tree: max_depth: 3 -weighted_linear_early_fusion: - monoview_classifier_name: "decision_tree" - monoview_classifier_config: - decision_tree: - max_depth: 6 - -weighted_linear_late_fusion: - classifiers_names: "decision_tree" - classifier_configs: - decision_tree: - max_depth: 3 diff --git a/multiview_platform/execute.py b/multiview_platform/execute.py index f12a455c1717d2178d9919f3a04957b5a2c6a80f..555b90d4feae67ebe00be9b60366e1b5dde929ac 100644 --- a/multiview_platform/execute.py +++ b/multiview_platform/execute.py @@ -2,13 +2,13 @@ import os -def execute(config_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), "examples", "config_files", "config_example_1.yml")): +def execute(config_path=None): from multiview_platform import versions as vs vs.test_versions() import sys from multiview_platform.mono_multi_view_classifiers import exec_classif - if sys.argv[1:]: + if config_path is None: exec_classif.exec_classif(sys.argv[1:]) else: if config_path == "example 0": diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost.py index 6fbfbd8b5998a54df863e26aab82e515a74269dc..e32d0ae95bc828ac41eeb9f849d8d3eadd54afc4 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost.py @@ -26,7 +26,7 @@ class Adaboost(AdaBoostClassifier, BaseMonoviewClassifier): ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. n_estimators : int number of estimators diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/random_forest.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/random_forest.py index 18e2bc4c3577156b002fec24bfcbf70594ae0aa0..ece278a56e54ab88ffc078e25facee452ac54217 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/random_forest.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/random_forest.py @@ -15,7 +15,7 @@ class RandomForest(RandomForestClassifier, BaseMonoviewClassifier): Parameters ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. n_estimators : int (default : 10) number of estimators diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py index 1cbcec740b2d83cf1d57f2d4b09fa19f87c9f990..09c345bae7993576dcc595f10e5accc56f480a83 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py @@ -15,7 +15,7 @@ class SGD(SGDClassifier, BaseMonoviewClassifier): Parameters ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. loss : str , (default = "hinge") diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_linear.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_linear.py index d7900a7f092705863c33b9aaa5280d4db7dd57c9..e5d293a624d2df1b21b8b4702b287c563ecf0c4e 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_linear.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_linear.py @@ -15,7 +15,7 @@ class SVMLinear(SVCClassifier, BaseMonoviewClassifier): Parameters ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_poly.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_poly.py index 2d8ef210346450da4200c3ae287e9612698876bd..d93bdcc352499390b749d42f95f5d2d799b69317 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_poly.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_poly.py @@ -17,7 +17,7 @@ class SVMPoly(SVCClassifier, BaseMonoviewClassifier): Parameters ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_rbf.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_rbf.py index 325afa102560d1e17e9665a39e82b09045f8fe74..1af02e4d6e7fffbd35c0b2d0d554006a46b55752 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_rbf.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/svm_rbf.py @@ -16,7 +16,7 @@ class SVMRBF(SVCClassifier, BaseMonoviewClassifier): Parameters ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. C : diff --git a/multiview_platform/mono_multi_view_classifiers/multiview/exec_multiview.py b/multiview_platform/mono_multi_view_classifiers/multiview/exec_multiview.py index f300d63ad89b52970f124a63a8af697a0260cb91..8748b795c4284ce0046e7e0e7d8eab3a89183e26 100644 --- a/multiview_platform/mono_multi_view_classifiers/multiview/exec_multiview.py +++ b/multiview_platform/mono_multi_view_classifiers/multiview/exec_multiview.py @@ -152,7 +152,7 @@ def exec_multiview_multicore(directory, core_index, name, learning_rate, labels_dictionary random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. labels : @@ -217,7 +217,7 @@ def exec_multiview(directory, dataset_var, name, classification_indices, labels_dictionary : dict dictionary of labels random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. labels diff --git a/multiview_platform/mono_multi_view_classifiers/multiview/multiview_utils.py b/multiview_platform/mono_multi_view_classifiers/multiview/multiview_utils.py index 6f3467c48dee245e3e6738bbd37015ca097e13bb..4144dd02ff12034e77a8600c37addd9d97168296 100644 --- a/multiview_platform/mono_multi_view_classifiers/multiview/multiview_utils.py +++ b/multiview_platform/mono_multi_view_classifiers/multiview/multiview_utils.py @@ -20,7 +20,7 @@ class BaseMultiviewClassifier(BaseClassifier): Parameters ---------- random_state : int seed, RandomState instance, or None (default=None) - The seed of the pseudo random number generator to use when + The seed of the pseudo random number multiview_generator to use when shuffling the data. """ diff --git a/multiview_platform/mono_multi_view_classifiers/result_analysis/error_analysis.py b/multiview_platform/mono_multi_view_classifiers/result_analysis/error_analysis.py index 1557f8d81857fd2e6c7438de7bb2d456b50823c0..e989ee36934b14dad57ce3ed62928189823b4d04 100644 --- a/multiview_platform/mono_multi_view_classifiers/result_analysis/error_analysis.py +++ b/multiview_platform/mono_multi_view_classifiers/result_analysis/error_analysis.py @@ -226,7 +226,7 @@ def plot_2d(data, classifiers_names, nb_classifiers, file_name, labels=None, fig.update_layout(paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)') fig.update_xaxes(showticklabels=True, ) - plotly.offline.plot(fig, filename=file_name + "err.html", + plotly.offline.plot(fig, filename=file_name + "error_analysis_2D.html", auto_open=False) del fig diff --git a/multiview_platform/mono_multi_view_classifiers/utils/execution.py b/multiview_platform/mono_multi_view_classifiers/utils/execution.py index 99534ae2f70e875fadc11c47ae4137d022cb91f9..a85db6da214ed295958ee720b8c43b9b12485be9 100644 --- a/multiview_platform/mono_multi_view_classifiers/utils/execution.py +++ b/multiview_platform/mono_multi_view_classifiers/utils/execution.py @@ -153,9 +153,9 @@ def init_log_file(name, views, cl_type, log, debug, label, """ if views is None: views = [] - result_directory = os.path.join(os.path.dirname( - os.path.dirname(os.path.dirname(os.path.realpath(__file__)))), - result_directory) + # result_directory = os.path.join(os.path.dirname( + # os.path.dirname(os.path.dirname(os.path.realpath(__file__)))), + # result_directory) if debug: result_directory = os.path.join(result_directory, name, "debug_started_" + time.strftime(