Package pyspark :: Package mllib :: Module classification :: Class SVMModel
[frames] | no frames]

Class SVMModel

source code

_common.LinearModel --+
                      |
                     SVMModel

A support vector machine.

>>> data = array([0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0, 3.0]).reshape(4,2)
>>> svm = SVMWithSGD.train(sc.parallelize(data))
>>> svm.predict(array([1.0])) > 0
True
Instance Methods
 
predict(self, x) source code