Repository navigation
MRG Refactor liblinear bindings - #1143
Conversation
Liblinear bindings removed from LinearSVC and LogisticRegression prediction code in favor of NumPy code. * no more copying of X at predict time * no more unchecked malloc at predict time * -4000 lines of C code * simpler handling of coef_ and intercept_ Also, support symbolic class names and classes_ on both estimators.
Restore code to be slightly closer to upstream (still not possible to run with the original library, though). Comment out some more code that we don't use to reduce build time.
|
beautiful ! tests pass + example render nicely ! |
|
Thanks a lot for the refactoring! Awesome 👍 |
|
Does this make |
|
Closes #388. |
There was a problem hiding this comment.
sweet! I was working on putting this into the common tests but progress kind of stalled. Can you do SVC next ;)
Not exactly, as I didn't touch the LibSVM bindings. |
|
Hm I thought that was about the linear case... guess it is not... or also for linear case of the SVC? But than that seems like more code, not less... |
|
I'm not sure. I might have a look at SVC as well, or I might not. As for the speed, I didn't thoroughly benchmark it, but it didn't seem any slower and it should take less memory. |
|
|
|
I'm not going to touch |
|
good idea ;) |
|
Alright, I think my work on this one is done. Any final opinions? @pprett perhaps? (I'm currently returning Fortran arrays from |
|
+1 for tackling |
|
@larsmans I think you are right and in this case we can use |
|
+1 for merge :) |
Refactor liblinear bindings: rewrote prediction code in Python
|
awesome, thanks :) |
|
More coming up :) |
Here's yet another refactoring of the liblinear bindings. I've replaced all the prediction code in
LinearSVCandLogisticRegressionwith equivalent NumPy code. Highlights:Xat predict timemallocat predict timecoef_andintercept_