Skip to content
Snippets Groups Projects
Commit 7f11136c authored by Dominique Benielli's avatar Dominique Benielli
Browse files

call alpha

parent 7d3bb6f1
No related branches found
No related tags found
No related merge requests found
Pipeline #4209 passed
......@@ -216,10 +216,10 @@ class MuCumboClassifier(BaseEnsemble, ClassifierMixin, UBoosting):
"""Compute values of confidence rate alpha given edge values."""
np.where(edges > 1.0, edges, 1.0)
alphas = 0.5 * np.log((1. + edges) / (1. - edges))
if np.any(np.isinf(alphas)) or np.any(np.isnan(alphas)):
alphas[np.where(np.isnan(alphas))[0]] = 1.0
if np.any(np.isinf(alphas)):
alphas[np.where(np.isinf(alphas))[0]] = 1.0
if np.any(np.isnan(alphas)):
alphas[np.where(np.isnan(alphas))[0]] = 1.0
return alphas
def _compute_cost(self, label_score, predicted_classes, y, alphas, betas,
......
......@@ -223,10 +223,10 @@ class MumboClassifier(BaseEnsemble, ClassifierMixin, UBoosting):
"""Compute values of confidence rate alpha given edge values."""
np.where(edges > 1.0, edges, 1.0)
alphas = 0.5 * np.log((1. + edges) / (1. - edges))
if np.any(np.isinf(alphas)) or np.any(np.isnan(alphas)):
alphas[np.where(np.isnan(alphas))[0]] = 1.0
if np.any(np.isinf(alphas)):
alphas[np.where(np.isinf(alphas))[0]] = 1.0
if np.any(np.isnan(alphas)):
alphas[np.where(np.isnan(alphas))[0]] = 1.0
return alphas
def _compute_cost_global(self, label_score_global, best_predicted_classes,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment