Skip to content

Commit

Permalink
better ci
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Dupre <[email protected]>
  • Loading branch information
xadupre committed May 22, 2024
1 parent 03db70c commit b396d8a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python_version: ['3.12', '3.11', '3.10', '3.9']
sklearn_version: ['==1.5.0', '==1.4.2', '==1.3.2', '==1.2.2', '==1.1.3']
include:
- sklearn_version: '==1.5.0'
documentation: 0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows-macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
matrix:
os: [windows-latest, macos-latest]
python_version: ['3.11', '3.10', '3.9']
sklearn_version: ['==1.5.0', '==1.4.2', '==1.3.2', '==1.2.2', '==1.1.3']
include:
- sklearn_version: '==1.5.0'
python_version: '3.11'
Expand Down
19 changes: 9 additions & 10 deletions skl2onnx/operator_converters/linear_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,22 @@ def convert_sklearn_linear_classifier(
elif isinstance(op, LogisticRegression):
classifier_attrs["post_transform"] = (
"LOGISTIC"
if (use_ovr or (multi_class == 0 and op.intercept_.size <= 1))
if (
use_ovr
or op.solver == "liblinear"
or (
multi_class == 0
and (len(op.coef_.shape) <= 1)
or min(op.coef_.shape) == 1
)
)
else "SOFTMAX"
)
else:
classifier_attrs["post_transform"] = (
"LOGISTIC" if multi_class > 2 else "SOFTMAX"
)

print(
"***",
multi_class,
classifier_attrs["post_transform"],
type(op),
number_of_classes,
op.__dict__,
)

if all(isinstance(i, str) for i in classes):
class_labels = [str(i) for i in classes]
classifier_attrs["classlabels_strings"] = class_labels
Expand Down

0 comments on commit b396d8a

Please sign in to comment.