Do you know what is the best way to force positive coefficients with Logistic Regression and Linear SVC using scikit learn?

for instance

svm = LinearSVC(loss='hinge'  )
coefficients = svm.coef_

Is there a way to force them to be positive numbers?


1 Answer 1


You can do that using the clogistic package. https://pypi.org/project/clogistic/


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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