Re: [scikit-learn] question about class_weights in LogisticRegression

2017-08-03 Thread Tom DLT
The class weights and sample weights are used in the same way, as a factor specific to each sample, in the loss function. In LogisticRegression, it is equivalent to incorporate this factor into a regularization parameter C specific to each sample. Tom 2017-08-01 18:30 GMT+02:00 Johnson, Jeremiah

Re: [scikit-learn] question about class_weights in LogisticRegression

2017-08-01 Thread Johnson, Jeremiah
Right, I know how the class_weight calculation is performed. But then those class weights are utilized during the model fit process in some way in liblinear, and that¹s what I am interested in. libSVM does class_weight[I] * C (https://www.csie.ntu.edu.tw/~cjlin/libsvm/); is the implementation in li

Re: [scikit-learn] question about class_weights in LogisticRegression

2017-08-01 Thread Stuart Reynolds
I hope not. And not accoring to the docs... https://github.com/scikit-learn/scikit-learn/blob/ab93d65/sklearn/linear_model/logistic.py#L947 class_weight : dict or 'balanced', optional Weights associated with classes in the form ``{class_label: weight}``. If not given, all classes are supposed to h

[scikit-learn] question about class_weights in LogisticRegression

2017-08-01 Thread Johnson, Jeremiah
Hello all, I'm looking for confirmation on an implementation detail that is somewhere in liblinear, but I haven't found documentation for yet. When the class_weights='balanced' parameter is set in LogisticRegression, then the regularisation parameter for an observation from class I is class_wei