diff --git a/config_files/config_test.yml b/config_files/config_test.yml index ecf24d313bfdf025fcfbe4e023839cf7ddffba96..a3d3fbc25d98738538e0d1d5b36f46400a71bca4 100644 --- a/config_files/config_test.yml +++ b/config_files/config_test.yml @@ -22,8 +22,8 @@ Classification: nb_folds: 2 nb_class: 2 classes: - type: ["multiview","monoview"] - algos_monoview: ["decision_tree", "adaboost"] + type: ["monoview"] + algos_monoview: ["all", ] algos_multiview: ["weighted_linear_early_fusion"] stats_iter: 2 metrics: ["accuracy_score", "f1_score"] diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/lasso.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/lasso.py index 0af82bc6ba94876281c42c6579e89937f8dfe53b..c36ad031781ebf978bc5fd5c00bb8a9a0e635166 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/lasso.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/lasso.py @@ -63,6 +63,7 @@ class Lasso(LassoSK, BaseMonoviewClassifier): neg_y = np.copy(y) neg_y[np.where(neg_y == 0)] = -1 super(Lasso, self).fit(X, neg_y) + self.feature_importances_ = self.coef_/np.sum(self.coef_) return self def predict(self, X): 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 b4a0e3d74a2097cd3e36d34e0740d1db10989cf2..bd0d8c70b70b25ec3fe89ed26c5d4e92729c12d3 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py @@ -79,6 +79,8 @@ class SGD(SGDClassifier, BaseMonoviewClassifier): interpret_string str to interpreted """ interpret_string = "" + import numpy as np + self.feature_importances_ = (self.coef_/np.sum(self.coef_)).reshape(self.coef_.shape[1]) return interpret_string 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 b71c1d318b1b0167ad80a370dc16a03d5d5a4dc7..ad867f07fcc24a06dff51230da459c13f94b1294 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 @@ -34,6 +34,12 @@ class SVMLinear(SVCClassifier, BaseMonoviewClassifier): self.param_names = ["C", "random_state"] self.distribs = [CustomUniform(loc=0, state=1), [random_state]] + def getInterpret(self, directory, y_test): + interpret_string = "" + import numpy as np + self.feature_importances_ = (self.coef_/np.sum(self.coef_)).reshape((self.coef_.shape[1],)) + return interpret_string + # def formatCmdArgs(args): # """Used to format kwargs for the parsed args"""