4 ms·
Statsmodels has a nice implementation of logistic regression more suited for statistical analysis. It has no default regularisation, nice labelled coefficients
by oli5679 7y ago
Statsmodels has a nice implementation of logistic regression more suited for statistical analysis.
It has no default regularisation, nice labelled coefficients table, and model evaluation metrics.
https://www.statsmodels.org/dev/generated/statsmodels.discrete.discrete_model.Logit.html https://www.statsmodels.org/dev/generated/statsmodels.discre...
This reflects the difference in intended uses. I view Sklearn as a collection of tools to help forecast a target, whilst statsmodels is collection of tools to examine a model you have of the data-generating process.
If you want to do the former, sensible defaults are helpful - for example random forest has many tune-able parameters, and I am glad maintainers haven't shrugged and left all unspecified, because I know I can quickly fit a reasonable first-cut model. For latter, you are better off using statsmodels. In a way this is part of the culture difference between statistics and machine learning.
http://brenocon.com/blog/2008/12/statistics-vs-machine-learning-fight/ http://brenocon.com/blog/2008/12/statistics-vs-machine-learn...
One common pain point with sklearn is that it uses numpy arrays as representation of data series, whilst a lot of the ecosystem create data cleaning and prepare their data as pandas dataframes.