From 4a5ad74370f76791a5142ce517b8d9cff92e5fc0 Mon Sep 17 00:00:00 2001 From: Dominique BENIELLI <dominique.benielli@univ-amu.fr> Date: Tue, 15 Oct 2019 14:57:12 +0200 Subject: [PATCH] doc string --- .../monoview/monoview_utils.py | 23 +++++ .../monoview_classifiers/adaboost.py | 74 +++++++++++++++- .../monoview_classifiers/adaboost_graalpy.py | 69 ++++++++++++++- .../monoview_classifiers/adaboost_pregen.py | 84 ++++++++++++++++++- .../monoview_classifiers/cb_boost.py | 53 +++++++++++- .../monoview_classifiers/cg_desc.py | 13 +++ .../monoview_classifiers/knn.py | 13 +++ .../monoview_classifiers/lasso.py | 58 ++++++++++++- .../monoview_classifiers/min_cq.py | 20 +++++ .../monoview_classifiers/min_cq_graalpy.py | 20 +++-- .../min_cq_graalpy_tree.py | 78 +++++++++++++++-- .../monoview_classifiers/random_forest.py | 19 +++-- .../monoview_classifiers/scm_pregen.py | 8 +- .../monoview_classifiers/sgd.py | 27 ++++-- .../monoview_classifiers/svm_linear.py | 12 ++- .../monoview_classifiers/svm_poly.py | 14 +++- .../monoview_classifiers/svm_rbf.py | 10 ++- 17 files changed, 549 insertions(+), 46 deletions(-) diff --git a/multiview_platform/mono_multi_view_classifiers/monoview/monoview_utils.py b/multiview_platform/mono_multi_view_classifiers/monoview/monoview_utils.py index 4ba9f364..e5b0b265 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview/monoview_utils.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview/monoview_utils.py @@ -18,12 +18,35 @@ __status__ = "Prototype" # Production, Development, Prototype # __date__ = 2016 - 03 - 25 def change_label_to_minus(y): + """ + Change the label 0 to minus one + + Parameters + ---------- + y : + + Returns + ------- + label y with -1 instead of 0 + + """ minus_y = np.copy(y) minus_y[np.where(y == 0)] = -1 return minus_y def change_label_to_zero(y): + """ + Change the label -1 to 0 + + Parameters + ---------- + y + + Returns + ------- + + """ zeroed_y = np.copy(y) zeroed_y[np.where(y == -1)] = 0 return zeroed_y 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 c52e0bfd..2b3d6423 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost.py @@ -17,12 +17,44 @@ classifier_class_name = "Adaboost" class Adaboost(AdaBoostClassifier, BaseMonoviewClassifier): """ - This class implement a Classifier with adaboost algorithm. + This class implement a Classifier with adaboost algorithm inherit from sklearn + AdaBoostClassifier + + Parameters + ---------- + + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + n_estimators : int number of estimators + + base_estimator : + + kwargs : others arguments + + + Attributes + ---------- + param_name : + + classed_params : + + distribs : + + weird_strings : + + plotted_metric : selection of metric to plot + + plotted_metric_name : name of the metric to plot + + step_predictions : """ def __init__(self, random_state=None, n_estimators=50, base_estimator=None, **kwargs): + super(Adaboost, self).__init__( random_state=random_state, n_estimators=n_estimators, @@ -39,6 +71,23 @@ class Adaboost(AdaBoostClassifier, BaseMonoviewClassifier): self.step_predictions = None def fit(self, X, y, sample_weight=None): + """ + Fit adaboost model + + Parameters + ---------- + X : {array-like, sparse matrix}, shape (n_samples, n_features) + + y : { array-like, shape (n_samples,) + Target values class labels in classification + + sample_weight : + + Returns + ------- + self : object + Returns self. + """ begin = time.time() super(Adaboost, self).fit(X, y, sample_weight=sample_weight) end = time.time() @@ -51,10 +100,31 @@ class Adaboost(AdaBoostClassifier, BaseMonoviewClassifier): return self def canProbas(self): - """Used to know if the classifier can return label probabilities""" + """ + Used to know if the classifier can return label probabilities + + Returns + ------- + True + """ return True def predict(self, X): + """ + + Parameters + ---------- + X : {array-like, sparse matrix}, shape (n_samples, n_features) + Training vectors, where n_samples is the number of samples + and n_features is the number of features. + For kernel="precomputed", the expected shape of X is + (n_samples, n_samples). + + Returns + ------- + predictions : ndarray of shape (n_samples, ) + The estimated labels. + """ begin = time.time() pred = super(Adaboost, self).predict(X) end = time.time() diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_graalpy.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_graalpy.py index 6052032a..f298906b 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_graalpy.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_graalpy.py @@ -15,6 +15,26 @@ classifier_class_name = "AdaboostGraalpy" class AdaBoostGP(BaseEstimator, ClassifierMixin, BaseBoost): """Scikit-Learn compatible AdaBoost classifier. Original code by Pascal Germain, adapted by Jean-Francis Roy. + + Parameters + ---------- + + n_iterations : int, optional + The number of iterations of the algorithm. Defaults to 200. + + iterations_to_collect_as_hyperparameters : list + Iteration numbers to collect while learning, that will be converted as hyperparameter values at evaluation time. + Defaults to None. + classifiers_generator : Transformer, optional + A transformer to convert input samples in voters' outputs. Default: Decision stumps transformer, with 10 stumps + per attributes. + callback_function : function, optional + A function to call at each iteration that is supplied learning information. Defaults to None. + + n_stumps : int ( default : 10) + + self_complemented : boolean (default : True + Attributes ---------- n_iterations : int, optional @@ -34,6 +54,7 @@ class AdaBoostGP(BaseEstimator, ClassifierMixin, BaseBoost): iterations_to_collect_as_hyperparameters=True, classifiers_generator=None, callback_function=None, n_stumps=10, self_complemented=True): + self.n_iterations = n_iterations self.n_stumps = n_stumps self.iterations_to_collect_as_hyperparameters = iterations_to_collect_as_hyperparameters @@ -158,9 +179,37 @@ class AdaBoostGP(BaseEstimator, ClassifierMixin, BaseBoost): class AdaboostGraalpy(AdaBoostGP, BaseMonoviewClassifier): + """AdaboostGraalpy + + Parameters + ---------- + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + n_iterations : in number of iterations (default : 200) + + n_stumps : int (default 1) + + kwargs : others arguments + + Attributes + ---------- + param_names : + + distribs : + + weird_strings : + + n_stumps : + + nbCores : + + """ def __init__(self, random_state=None, n_iterations=200, n_stumps=1, **kwargs): + super(AdaboostGraalpy, self).__init__( n_iterations=n_iterations, n_stumps=n_stumps @@ -177,10 +226,28 @@ class AdaboostGraalpy(AdaBoostGP, BaseMonoviewClassifier): self.nbCores = kwargs["nbCores"] def canProbas(self): - """Used to know if the classifier can return label probabilities""" + """ + Used to know if the classifier can return label probabilities + + Returns + ------- + True in any case + """ return True def getInterpret(self, directory, y_test): + """ + + Parameters + ---------- + directory : + + y_test : + + Returns + ------- + retur string of interpret + """ np.savetxt(directory + "train_metrics.csv", self.losses, delimiter=',') np.savetxt(directory + "y_test_step.csv", self.test_preds, delimiter=',') diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_pregen.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_pregen.py index 511a5320..b2949535 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_pregen.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/adaboost_pregen.py @@ -19,7 +19,55 @@ classifier_class_name = "AdaboostPregen" class AdaboostPregen(AdaBoostClassifier, BaseMonoviewClassifier, PregenClassifier): + """ + Parameters + ---------- + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + n_estimators : int number of estimators (default : 50) + + base_estimator : + + n_stumps : int (default : 1) + + estimators_generator : str, (default : "Stumps") + + max_depth : int (default : 1) + + self_complemeted : bool, (default : True) + + kwargs : others arguments + + + Attributes + ---------- + + param_names : list of parameters names + + classed_params : list of parameters names + + distribs : + + weird_strings : + + plotted_metric + + plotted_metric_name : str name of plotted metric + + step_predictions : + + estimators_generator : + + max_depth : + + n_stumps : + + self_complemented : + + """ def __init__(self, random_state=None, n_estimators=50, base_estimator=None, n_stumps=1, estimators_generator="Stumps", max_depth=1, self_complemeted=True, @@ -48,6 +96,21 @@ class AdaboostPregen(AdaBoostClassifier, BaseMonoviewClassifier, self.self_complemented = self_complemeted def fit(self, X, y, sample_weight=None): + """ + Fit the AdaboostPregen + + Parameters + ---------- + X : {array-like, sparse matrix}, shape (n_samples, n_features) + For kernel="precomputed", the expected shape of X is + (n_samples_test, n_samples_train). + y : { array-like, shape (n_samples,) + Target values class labels in classification + + sample_weight : + + + """ begin = time.time() pregen_X, pregen_y = self.pregen_voters(X, y) super(AdaboostPregen, self).fit(pregen_X, pregen_y, @@ -68,10 +131,29 @@ class AdaboostPregen(AdaBoostClassifier, BaseMonoviewClassifier, range(self.estimator_errors_.shape[0])]) def canProbas(self): - """Used to know if the classifier can return label probabilities""" + """ + Used to know if the classifier can return label probabilities + + Returns + ------- + True + """ return True def predict(self, X): + """ + + Parameters + ---------- + + X : {array-like, sparse matrix}, shape (n_samples, n_features) + For kernel="precomputed", the expected shape of X is + (n_samples_test, n_samples_train). + + Returns + ------- + + """ begin = time.time() pregen_X, _ = self.pregen_voters(X) pred = super(AdaboostPregen, self).predict(pregen_X) diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cb_boost.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cb_boost.py index b86aee42..6955a79e 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cb_boost.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cb_boost.py @@ -5,9 +5,34 @@ from ..monoview.monoview_utils import BaseMonoviewClassifier, CustomRandint classifier_class_name = "CBBoost" class CBBoost(CBBoostClassifier, BaseMonoviewClassifier): + """ + Parameters + ---------- + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + n_max_iterations : + + n_stumps : + + kwargs : others arguments + + Attributes + ---------- + param_names : names of parameter used for hyper parameter search + + distribs : + + classed_params : + + weird_strings : + + """ def __init__(self, random_state=None, n_max_iterations=500, n_stumps=1, **kwargs): + super(CBBoost, self).__init__(n_max_iterations=n_max_iterations, random_state=random_state, self_complemented=True, @@ -25,13 +50,39 @@ class CBBoost(CBBoostClassifier, BaseMonoviewClassifier): self.weird_strings = {} def canProbas(self): - """Used to know if the classifier can return label probabilities""" + """ + Used to know if the classifier can return label probabilities + + Returns + ------- + True + """ return True def getInterpret(self, directory, y_test): + """ + return interpretation string + + Parameters + ---------- + + directory : + + y_test : + + Returns + ------- + + """ return self.getInterpretCBBoost(directory, y_test) def get_name_for_fusion(self): + """ + + Returns + ------- + string name of fusion + """ return "CBB" diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cg_desc.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cg_desc.py index e5ef93cd..85e8cdca 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cg_desc.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/cg_desc.py @@ -5,10 +5,23 @@ from ..monoview.monoview_utils import BaseMonoviewClassifier, CustomRandint classifier_class_name = "CGDesc" class CGDesc(ColumnGenerationClassifierQar, BaseMonoviewClassifier): + """ + Parameters + ---------- + random_state + n_max_iterations + n_stumps + estimators_generator + twice_the_same + max_depth + kwargs + + """ def __init__(self, random_state=None, n_max_iterations=500, n_stumps=1, estimators_generator="Stumps", twice_the_same=True, max_depth=1, **kwargs): + super(CGDesc, self).__init__(n_max_iterations=n_max_iterations, random_state=random_state, self_complemented=True, diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/knn.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/knn.py index 5a08934d..e95be5ac 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/knn.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/knn.py @@ -11,9 +11,22 @@ classifier_class_name = "KNN" class KNN(KNeighborsClassifier, BaseMonoviewClassifier): + """ + Implement extention of KNeighborsClassifier of sklearn + for the usage of the multiview_platform. + Parameters + ---------- + random_state + n_neighbors + weights + algorithm + p + kwargs + """ def __init__(self, random_state=None, n_neighbors=5, weights='uniform', algorithm='auto', p=2, **kwargs): + super(KNN, self).__init__( n_neighbors=n_neighbors, weights=weights, 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 30af6f5b..0e8b3c41 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/lasso.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/lasso.py @@ -12,9 +12,42 @@ __status__ = "Prototype" # Production, Development, Prototype classifier_class_name = "Lasso" class Lasso(LassoSK, BaseMonoviewClassifier): + """ + Parameters + ---------- + random_state : + + alpha : float, optional + Constant that multiplies the L1 term. Defaults to 1.0. + ``alpha = 0`` is equivalent to an ordinary least square, solved + by the :class:`LinearRegression` object. For numerical + reasons, using ``alpha = 0`` is with the Lasso object is + not advised + and you should prefer the LinearRegression object. (default( : 10) + + max_iter : int The maximum number of iterations (default : 10) + + warm_start : bool, optional + When set to True, reuse the solution of the previous call to fit as + initialization, otherwise, just erase the previous solution. + + kwargs : others arguments + + Attributes + ---------- + param_name : + + classed_params : + + distribs : + + weird_strings : + + """ def __init__(self, random_state=None, alpha=1.0, max_iter=10, warm_start=False, **kwargs): + super(Lasso, self).__init__( alpha=alpha, max_iter=max_iter, @@ -40,12 +73,31 @@ class Lasso(LassoSK, BaseMonoviewClassifier): return signed def canProbas(self): - """Used to know if the classifier can return label probabilities""" + """ + Used to know if the classifier can return label probabilities + + Returns + ------- + False + """ return False def getInterpret(self, directory, y_test): - interpretString = "" - return interpretString + """ + return the interpreted string + + Parameters + ---------- + directory : + + y_test : + + Returns + ------- + interpreted string, str interpret_string + """ + interpret_string = "" + return interpret_string # def formatCmdArgs(args): diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq.py index 21345552..6956a855 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq.py @@ -444,6 +444,13 @@ class DecisionStumpVoter(Voter): direction : int (-1 or 1) Used to reverse classification decision + + Attributes + ---------- + + attribute_index : + threshold : + direction : """ def __init__(self, attribute_index, threshold, direction=1): @@ -508,6 +515,19 @@ class StumpsVotersGenerator(VotersGenerator): def generate(self, X, y=None, self_complemented=False, only_complements=False): + """ + + Parameters + ---------- + X + y + self_complemented + only_complements + + Returns + ------- + + """ voters = [] if len(X) != 0: for i in range(len(X[0])): diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy.py index 90e196ab..ddae76cb 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy.py @@ -9,14 +9,22 @@ classifier_class_name = "MinCQGraalpy" class MinCQGraalpy(RegularizedBinaryMinCqClassifier, BaseMonoviewClassifier): """ + MinCQGraalpy extend of ``RegularizedBinaryMinCqClassifier `` Parameters ---------- - random_state - mu - self_complemented - n_stumps_per_attribute - kwargs + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + mu : float, (default: 0.01) + + self_complemented : bool (default : True) + + n_stumps_per_attribute : (default: =1 + + kwargs : others arguments + Attributes ---------- @@ -30,7 +38,7 @@ class MinCQGraalpy(RegularizedBinaryMinCqClassifier, BaseMonoviewClassifier): weird_strings - nbCores + nbCores : number of cores """ def __init__(self, random_state=None, mu=0.01, self_complemented=True, diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy_tree.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy_tree.py index bc2a228c..3e0f370a 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy_tree.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/min_cq_graalpy_tree.py @@ -12,13 +12,35 @@ class MinCQGraalpyTree(RegularizedBinaryMinCqClassifier, Parameters ---------- - random_state - mu - self_complemented - n_stumps_per_attribute - max_depth - kwargs + random_state : + mu : (default : 0.01) + + self_complemented : ( default : True) + + n_stumps_per_attribute : int ( default : 1) + max_depth : + + kwargs : others parameters + + + Attributes + ---------- + param_name : + + distribs : + + classed_params : + + n_stumps_per_attribute : int + + weird_strings : + + max_depth : + + random_state : + + nbCores : """ def __init__(self, random_state=None, mu=0.01, self_complemented=True, n_stumps_per_attribute=1, max_depth=2, **kwargs): @@ -44,10 +66,28 @@ class MinCQGraalpyTree(RegularizedBinaryMinCqClassifier, self.nbCores = kwargs["nbCores"] def canProbas(self): - """Used to know if the classifier can return label probabilities""" + """ + Used to know if the classifier can return label probabilities + + Returns + ------- + True + """ return True def set_params(self, **params): + """ + set parameter in the input dictionary + + Parameters + ---------- + params : dict parameter to set + + Returns + ------- + self : object + Returns self. + """ self.mu = params["mu"] self.random_state = params["random_state"] self.n_stumps_per_attribute = params["n_stumps_per_attribute"] @@ -55,11 +95,35 @@ class MinCQGraalpyTree(RegularizedBinaryMinCqClassifier, return self def get_params(self, deep=True): + """ + get parameter + + Parameters + ---------- + deep : (boolean (default : True) not used + + Returns + ------- + dictionary of parameter as key and its values + """ return {"random_state": self.random_state, "mu": self.mu, "n_stumps_per_attribute": self.n_stumps_per_attribute, "max_depth": self.max_depth} def getInterpret(self, directory, y_test): + """ + + Parameters + ---------- + directory : + + y_test : + + + Returns + ------- + string for interpretation interpret_string + """ interpret_string = "Cbound on train :" + str(self.train_cbound) np.savetxt(directory + "times.csv", np.array([self.train_time, 0])) # interpret_string += "Train C_bound value : "+str(self.cbound_train) 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 8b2caef1..95c16e92 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 @@ -14,25 +14,28 @@ class RandomForest(RandomForestClassifier, BaseMonoviewClassifier): Parameters ---------- - random_state + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. - n_estimators + n_estimators : int (default : 10) number of estimators - max_depth : int maximum of depth (default : 10) + max_depth : int , optional (default : None) maximum of depth criterion : criteria (default : 'gini') - kwargs + kwargs : others arguments + Attributes ---------- - param_names + param_names : - distribs + distribs : - classed_params + classed_params : - weird_strings + weird_strings : """ def __init__(self, random_state=None, n_estimators=10, diff --git a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/scm_pregen.py b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/scm_pregen.py index 57026c02..36357707 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/scm_pregen.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/scm_pregen.py @@ -18,7 +18,10 @@ class SCMPregen(BaseMonoviewClassifier, PregenClassifier, scm): Parameters ---------- - random_state + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + model_type max_rules p @@ -72,7 +75,7 @@ class SCMPregen(BaseMonoviewClassifier, PregenClassifier, scm): Returns ------- - parame + parameters dictionary """ params = super(SCMPregen, self).get_params(deep) params["estimators_generator"] = self.estimators_generator @@ -90,6 +93,7 @@ class SCMPregen(BaseMonoviewClassifier, PregenClassifier, scm): X {array-like, sparse matrix}, shape (n_samples, n_features) For kernel="precomputed", the expected shape of X is (n_samples_test, n_samples_train). + y : { array-like, shape (n_samples,) Target values class labels in classification 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 f8a10d6f..2418b13f 100644 --- a/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py +++ b/multiview_platform/mono_multi_view_classifiers/monoview_classifiers/sgd.py @@ -13,11 +13,28 @@ class SGD(SGDClassifier, BaseMonoviewClassifier): Parameters ---------- - random_state - loss - penalty - alpha - kwargs + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + loss : str , (default = "hinge") + penalty : str, (default = "l2") + + alpha : float, (default = 0.0001) + + kwargs : other arguments + + + Attributes + ---------- + param_names : + + distribs : + + classed_params : + + weird_strings : + """ def __init__(self, random_state=None, loss='hinge', penalty='l2', alpha=0.0001, **kwargs): 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 e26e5796..e727fed1 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 @@ -13,9 +13,15 @@ class SVMLinear(SVCClassifier, BaseMonoviewClassifier): Parameters ---------- - random_state - C - kwargs + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + + C : float, optional (default=1.0) + Penalty parameter C of the error term. + + kwargs : others arguments """ def __init__(self, random_state=None, C=1.0, **kwargs): 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 3d389802..a745092f 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 @@ -14,13 +14,19 @@ class SVMPoly(SVCClassifier, BaseMonoviewClassifier): Parameters ---------- - random_state + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. - C - degree + C : float, optional (default=1.0) + Penalty parameter C of the error term. + + + degree : + + kwargs : others arguments - kwargs Attributes ---------- 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 16727901..b3418453 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 @@ -14,9 +14,13 @@ class SVMRBF(SVCClassifier, BaseMonoviewClassifier): Parameters ---------- - random_state - C - kwargs + random_state : int seed, RandomState instance, or None (default=None) + The seed of the pseudo random number generator to use when + shuffling the data. + + C : + + kwargs : others arguments Attributes ---------- -- GitLab