Using sklearn I can consider sample weights in my model, like this:

from sklearn.linear_model import LogisticRegression
logreg = LogisticRegression(solver='liblinear')
logreg.fit(X_train, y_train, sample_weight=w_train)

Is there some clever way to consider sample weights also in the Logit method of statsmodel.api?

import statsmodels.api as sm
logit = sm.Logit(y, X)

It seems that there is a way of using sample weights which requires a little more work than just using a single argument, see this stackoverflow answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.