Closed krb19-econ closed 2 years ago
Have you tried supplying the same random_state
parameters to both LazyClassifier
and the sklearn manually-fit classifiers?
Yes. As mentioned in the first image in the original post, the random state was 123. Using that, I have used the same train and test datasets for both LazyClassifier
and manual sklearn.
Thanks for pointing out, but LogisticRegression
in scikit-learn also takes a random_state
parameter. See here: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression
LazyClassifier
also takes a random_state
parameter. See here: https://github.com/shankarpandala/lazypredict/blob/652f5de3d1a21a826cac32967eb36549c8cd3b57/lazypredict/Supervised.py#L210-L218
These random_state
parameters were not specified yet. Maybe try specifying similar values for it and see if the results are still different.
Thanks for mentioning that. The random_state
under LazyClassifier
is given as 42, image attached.
I used the same under Logistic Regression
while doing it manually. However the result is still coming out to be different.
It will never be same. lazypredict does preprocessing of data internally before doing any fit.
I feel like this is not completely solved with the last comment. How should we treat the results of the lazy classifier then? Is it even useful if we take this into consideration? Does it use the same preprocessing steps for each of the models? Can this be at least a relative indicator for the top models (e.g. SVC gave the best accuracy after lazy classifier prediction but even though we cannot get the same accuracy by running isolated SVC model - we can say that it will give better accuracy than any other model that is executed isolated)?
Describe the bug I have tried using lazypredict for classification algorithms. However, when I run a certain model manually, it provides different performance metrics.
Have attached images using the example given in the documentation.
Screenshots
Image of models from lazypredict![image](https://user-images.githubusercontent.com/83277978/142439353-2beee189-2a31-41b3-aedd-6135f212b6ad.png)
Running logistic regression manually![image](https://user-images.githubusercontent.com/83277978/142440236-a1d1326d-e0bb-4bc1-8b70-9e75f5673764.png)