SSVM is a reformulation of conventional SVM and can be solved by a fast Newton-Armijo algorithm.For more detail about SSVM, you can see this introduction.
This project use matlab engine for python to call matlab function, and create a sklearn-like way to use those functions
After import ssvm.py
package, you can use Smooth Support Vector Classification(SSVC)
& Smooth Support Vector Regression(SSVR)
with function below:
.fit(data, label)
.predict(data)
.score(data, label)
.print_params()
.get_params()
just like sklearn, very easy, right:-)?
Please install python matlab api first.
You can use SSVC to classification or SSVR to do regression(notice: both linear-only).
ssvc.m
、ssvr.m
、ssvm.py
- if you want to use SSVC, use
from ssvm import SSVC
- if you want to use SSVR, use
from ssvm import SSVR
ssvc = SSVC()
orssvr = SSVR()
ssvc.fit(data, label)
orssvr.fit(data, value)
notice that about input format:
- data: shape must be (m, n) array-like type, which m is data size and n is feature number
- label/value: shape must be (1, m) or (m, 1) array-like type, which m is data size
use .predict(data)
to predict##
you can see demo code in SSVC_Demo.ipynb
& SSVR_Demo.ipynb