sklearn_pmml_model.svm#

The sklearn.svm module includes Support Vector Machine algorithms.

Submodules#

Package Contents#

Classes#

PMMLLinearSVC

Linear Support Vector Classification.

PMMLLinearSVR

Linear Support Vector Regression.

PMMLNuSVC

Nu-Support Vector Classification.

PMMLNuSVR

Nu Support Vector Regression.

PMMLSVC

C-Support Vector Classification.

PMMLSVR

Epsilon-Support Vector Regression.

class sklearn_pmml_model.svm.PMMLLinearSVC(pmml)#

Bases: sklearn_pmml_model.base.OneHotEncodingMixin, sklearn_pmml_model.base.PMMLBaseClassifier, sklearn.svm.LinearSVC

Linear Support Vector Classification.

Similar to SVC with parameter kernel=’linear’, but implemented in terms of liblinear rather than libsvm, so it has more flexibility in the choice of penalties and loss functions and should scale better to large numbers of samples.

This class supports both dense and sparse input and the multiclass support is handled according to a one-vs-the-rest scheme.

The PMML model is assumed to be equivalent to PMMLLogisticRegression.

Parameters:
pmmlstr, object

Filename or file object containing PMML data.

Notes

Specification: http://dmg.org/pmml/v4-3/Regression.html

fit(x, y)#

Not supported: PMML models are already fitted.

_more_tags()#
class sklearn_pmml_model.svm.PMMLLinearSVR(pmml)#

Bases: sklearn_pmml_model.base.OneHotEncodingMixin, sklearn_pmml_model.base.PMMLBaseRegressor, sklearn.svm.LinearSVR

Linear Support Vector Regression.

Similar to SVR with parameter kernel=’linear’, but implemented in terms of liblinear rather than libsvm, so it has more flexibility in the choice of penalties and loss functions and should scale better to large numbers of samples.

This class supports both dense and sparse input.

The PMML model is assumed to be equivalent to PMMLLinearRegression.

Parameters:
pmmlstr, object

Filename or file object containing PMML data.

Notes

Specification: http://dmg.org/pmml/v4-3/Regression.html

fit(x, y)#

Not supported: PMML models are already fitted.

_more_tags()#
class sklearn_pmml_model.svm.PMMLNuSVC(pmml)#

Bases: sklearn_pmml_model.base.OneHotEncodingMixin, sklearn_pmml_model.base.PMMLBaseClassifier, sklearn_pmml_model.svm._base.PMMLBaseSVM, sklearn.svm.NuSVC

Nu-Support Vector Classification.

Similar to SVC but uses a parameter to control the number of support vectors.

The implementation is based on libsvm.

Parameters:
pmmlstr, object

Filename or file object containing PMML data.

Notes

Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html

_prepare_data(X)#
decision_function(X, *args, **kwargs)#

Evaluate the decision function for the samples in X.

Parameters:
Xarray-like of shape (n_samples, n_features)

The input samples.

Returns:
Xndarray of shape (n_samples, n_classes * (n_classes-1) / 2)

Returns the decision function of the sample for each class in the model. If decision_function_shape=’ovr’, the shape is (n_samples, n_classes).

Notes

If decision_function_shape=’ovo’, the function values are proportional to the distance of the samples X to the separating hyperplane. If the exact distances are required, divide the function values by the norm of the weight vector (coef_). See also this question for further details. If decision_function_shape=’ovr’, the decision function is a monotonic transformation of ovo decision function.

fit(x, y)#

Not supported: PMML models are already fitted.

_more_tags()#
class sklearn_pmml_model.svm.PMMLNuSVR(pmml)#

Bases: sklearn_pmml_model.base.OneHotEncodingMixin, sklearn_pmml_model.base.PMMLBaseRegressor, sklearn_pmml_model.svm._base.PMMLBaseSVM, sklearn.svm.NuSVR

Nu Support Vector Regression.

Similar to NuSVC, for regression, uses a parameter nu to control the number of support vectors. However, unlike NuSVC, where nu replaces C, here nu replaces the parameter epsilon of epsilon-SVR.

The implementation is based on libsvm.

Parameters:
pmmlstr, object

Filename or file object containing PMML data.

Notes

Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html

_prepare_data(X)#
fit(x, y)#

Not supported: PMML models are already fitted.

_more_tags()#
class sklearn_pmml_model.svm.PMMLSVC(pmml)#

Bases: sklearn_pmml_model.base.OneHotEncodingMixin, sklearn_pmml_model.base.PMMLBaseClassifier, sklearn_pmml_model.svm._base.PMMLBaseSVM, sklearn.svm.SVC

C-Support Vector Classification.

The implementation is based on libsvm. The multiclass support is handled according to a one-vs-one scheme.

For details on the precise mathematical formulation of the provided kernel functions and how gamma, coef0 and degree affect each other, see the corresponding section in the narrative documentation: Kernel functions.

Parameters:
pmmlstr, object

Filename or file object containing PMML data.

Notes

Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html

_prepare_data(X)#
decision_function(X, *args, **kwargs)#

Evaluate the decision function for the samples in X.

Parameters:
Xarray-like of shape (n_samples, n_features)

The input samples.

Returns:
Xndarray of shape (n_samples, n_classes * (n_classes-1) / 2)

Returns the decision function of the sample for each class in the model. If decision_function_shape=’ovr’, the shape is (n_samples, n_classes).

Notes

If decision_function_shape=’ovo’, the function values are proportional to the distance of the samples X to the separating hyperplane. If the exact distances are required, divide the function values by the norm of the weight vector (coef_). See also this question for further details. If decision_function_shape=’ovr’, the decision function is a monotonic transformation of ovo decision function.

fit(x, y)#

Not supported: PMML models are already fitted.

_more_tags()#
class sklearn_pmml_model.svm.PMMLSVR(pmml)#

Bases: sklearn_pmml_model.base.OneHotEncodingMixin, sklearn_pmml_model.base.PMMLBaseRegressor, sklearn_pmml_model.svm._base.PMMLBaseSVM, sklearn.svm.SVR

Epsilon-Support Vector Regression.

The free parameters in the model are C and epsilon. The implementation is based on libsvm.

For details on the precise mathematical formulation of the provided kernel functions and how gamma, coef0 and degree affect each other, see the corresponding section in the narrative documentation: Kernel functions.

Parameters:
pmmlstr, object

Filename or file object containing PMML data.

Notes

Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html

_prepare_data(X)#
fit(x, y)#

Not supported: PMML models are already fitted.

_more_tags()#