Skip to content

Commit

Permalink
(hot-fix) fit_learner now checks if a learner is setted BEFORE checki…
Browse files Browse the repository at this point in the history
…ng if mq.ARGUMENTS_SETTED is True
  • Loading branch information
Bachega committed Feb 7, 2025
1 parent cead772 commit 9008aee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mlquantify/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ def fit_learner(self, X, y):
y : array-like
Training labels.
"""
if mq.ARGUMENTS_SETTED:
if self.learner is not None:
if not self.learner_fitted:
self.learner_.fit(X, y)
elif mq.ARGUMENTS_SETTED:
if self.is_probabilistic and mq.arguments["posteriors_test"] is not None:
return
elif not self.is_probabilistic and mq.arguments["y_pred"] is not None:
return
else:
if not self.learner_fitted:
self.learner_.fit(X, y)

def predict_learner(self, X):
"""Predict the class labels or probabilities for the given data.
Expand Down

0 comments on commit 9008aee

Please sign in to comment.