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

Minor set_params bug

parent 124ab38a
Branches
Tags
No related merge requests found
......@@ -739,7 +739,7 @@ def getInterpretBase(classifier, directory, classifier_name, weights,
interpretString += "\n \t It generated {} columns by attributes and used {} iterations to converge, and selected {} couple(s) of opposed voters".format(classifier.n_stumps,
len(weights_sort), classifier.nb_opposed_voters)
if max(weights) > 0.50:
interpretString += "\n \t The vote is useless in this context : voter n°{} is a dictator of weight > 0.50".format(classifier.chosen_columns_[np.argmax(np.array(weights))])
interpretString += "\n \t The vote is useless in this context : voter nb {} is a dictator of weight > 0.50".format(classifier.chosen_columns_[np.argmax(np.array(weights))])
if len(weights_sort) == classifier.n_max_iterations or len(weights) == classifier.n_total_hypotheses_:
if len(weights) == classifier.n_max_iterations:
interpretString += ", and used all available iterations, "
......
......@@ -81,6 +81,7 @@ class ColumnGenerationClassifierQar(BaseEstimator, ClassifierMixin, BaseBoost):
self.n_max_iterations = params["n_max_iterations"]
# self.n_stumps = params["n_stumps_per_attribute"]
# self.use_r = params["use_r"]
return self
def fit(self, X, y):
......
......@@ -31,6 +31,7 @@ def randomizedSearch(X_train, y_train, randomState, outputFileName, classifierMo
nIter = nb_possible_combinations
randomSearch = RandomizedSearchCV(estimator, n_iter=nIter, param_distributions=params_dict, refit=True,
n_jobs=nbCores, scoring=scorer, cv=KFolds, random_state=randomState)
print(estimator)
detector = randomSearch.fit(X_train, y_train)
bestParams = estimator.genBestParams(detector)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment