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

Culster quick test

parent b1789ccc
Branches
Tags
No related merge requests found
...@@ -61,6 +61,7 @@ class ColumnGenerationClassifier(BaseEstimator, ClassifierMixin, BaseBoost): ...@@ -61,6 +61,7 @@ class ColumnGenerationClassifier(BaseEstimator, ClassifierMixin, BaseBoost):
self.collected_dual_constraint_violations_ = {} self.collected_dual_constraint_violations_ = {}
for k in range(min(n, self.n_max_iterations if self.n_max_iterations is not None else np.inf)): for k in range(min(n, self.n_max_iterations if self.n_max_iterations is not None else np.inf)):
beg=time.time()
# Find worst weak hypothesis given alpha. # Find worst weak hypothesis given alpha.
h_values = ma.array(np.squeeze(np.array((alpha).T.dot(y_kernel_matrix).T)), fill_value=-np.inf) h_values = ma.array(np.squeeze(np.array((alpha).T.dot(y_kernel_matrix).T)), fill_value=-np.inf)
h_values[self.chosen_columns_] = ma.masked h_values[self.chosen_columns_] = ma.masked
...@@ -87,6 +88,8 @@ class ColumnGenerationClassifier(BaseEstimator, ClassifierMixin, BaseBoost): ...@@ -87,6 +88,8 @@ class ColumnGenerationClassifier(BaseEstimator, ClassifierMixin, BaseBoost):
self.train_metrics.append(self.plotted_metric.score(y, signs_array)) self.train_metrics.append(self.plotted_metric.score(y, signs_array))
self.gammas.append(accuracy_score(y, signs_array)) self.gammas.append(accuracy_score(y, signs_array))
self.bounds.append(math.exp(-2 * np.sum(np.square(np.array(self.gammas))))) self.bounds.append(math.exp(-2 * np.sum(np.square(np.array(self.gammas)))))
end=time.time()
print(beg-end)
self.nb_opposed_voters = self.check_opposed_voters() self.nb_opposed_voters = self.check_opposed_voters()
self.compute_weights_(w) self.compute_weights_(w)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment