I agree. I suspect this was an unintentional omission, in fact. Apart from which, sample_weight support in liblinear could be merged from https://github.com/scikit-learn/scikit-learn/pull/2784 which is dormant, and merely needs some core contributors to show interest in merging it...
On 27 August 2015 at 10:15, Valentin Stolbunov <valentin.stolbu...@gmail.com > wrote: > Hello everyone, > > I noticed that two of the three solvers in the logistic regression module > (newton-cg and lbfgs) accept sample weights, but this feature is hidden > away from users by not recognizing sample_weight as parameter in .ft(). > Instead, sample_weight is set to ones (line 555 of logistic.py). To the > best of my knowledge this is because the default solver (liblinear) does > not support them? > > Could we instead allow sample_weight as a parameter (default None) and set > them to ones only if the chosen solver is liblinear (with appropriate > documentation notes - similar to the way the L1 penalty is supported only > by liblinear)? > > I realize that SGDClassifier's .fit() accepts sample weights and the loss > can be set to 'log', however this isn't exactly the same. > > What do you think? > > Valentin > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Scikit-learn-general mailing list > Scikit-learn-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general > >
------------------------------------------------------------------------------
_______________________________________________ Scikit-learn-general mailing list Scikit-learn-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scikit-learn-general