Skip to content

Commit

Permalink
fix: sklearn 1.3.2 ci fail
Browse files Browse the repository at this point in the history
The attribute classes was introduced later on 1.4. Changed the test to
not rely on it.

Signed-off-by: boccaff <[email protected]>
  • Loading branch information
boccaff committed Feb 20, 2025
1 parent 99e1c09 commit bd9bd50
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions skl2onnx/operator_converters/target_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def convert_sklearn_target_encoder(
input_idx = 0
dimension_idx = 0

if (op.target_type_ == "multiclass") or (
isinstance(op.classes_.dtype, np.int64) and (len(op.classes_) > 2)
):
raise NotImplementedError("multiclass TargetEncoder is not supported")
if op.target_type_ not in ("binary", "continuous"):
raise NotImplementedError(
"Current implementation of the converter only support TargetEncoder for"
" binary classification or 1d regression (sklearn target types binary"
" or continuous). See scikit-learn type_of_target documentation for details."
)
for categories, encodings in zip(op.categories_, op.encodings_):
if len(categories) == 0:
continue
Expand Down

0 comments on commit bd9bd50

Please sign in to comment.