Skip to content

Commit

Permalink
fix(_find_ml_task): Deal with case where estimator is unfitted and `y…
Browse files Browse the repository at this point in the history
…` is None
  • Loading branch information
auguste-probabl committed Jan 16, 2025
1 parent a3715db commit 112167f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions skore/src/skore/sklearn/find_ml_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def _find_ml_task(y, estimator=None) -> MLTask:
if estimator.classes_.size > 2:
return "multiclass-classification"
else: # fallback on the target
if y is None:
return "unsupported"

target_type = type_of_target(y)
if target_type == "binary":
return "binary-classification"
Expand Down

0 comments on commit 112167f

Please sign in to comment.