4

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?

Alex
  • 165
  • 6

1 Answers1

2

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