[bug] Performance different between sklearn and dask-ml LogisticRegression for multiple classification problem
- Dominant language
- Python
- Stars
- 951
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
I tried to load the trained model from dask-ml into sklearn. It gave different results.
And I found out that, even I use fresh trained model, dask-ml estimator's result is still different with sklearn esitmator.
Here is the code I used:
```
from dask_ml.linear_model import LogisticRegression as DaskLogisticRegression
from sklearn.linear_model import LogisticRegression
dask_m = DaskLogisticRegression(solver='lbfgs')
dask_m.fit(X_train.values, y_train.values)
predict = dask_m.predict(X_test.values)
test_acc = metrics.accuracy_score(y_test, predict)
print('test acc', test_acc)
m = LogisticRegression(multi_class='ovr', n_jobs=1)
m.fit(X_train.values, y_train.values)
predict = m.predict(X_test.values)
test_acc = metrics.accuracy_score(y_test, predict)
print('test acc', test_acc)
```
output:
```
test acc 0.1609371578716882
test acc 0.4484344208451938
```
I tried to make two models have the same parameters. However, the performance results are different.
Even if I use the empty/default parameters setting, the performance results are still different.
Any idea?
The data I used has >2 classes.
When I tried it with a binary classification problem, the result is very close. Therefore, the problem happens for multiple classes.
Contributor guide
Assessment
This issue has not been assessed yet.