:py:mod:`sklearn_pmml_model.svm` ================================ .. py:module:: sklearn_pmml_model.svm .. autoapi-nested-parse:: The :mod:`sklearn.svm` module includes Support Vector Machine algorithms. .. !! processed by numpydoc !! Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 _base/index.rst _classes/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: sklearn_pmml_model.svm.PMMLLinearSVC sklearn_pmml_model.svm.PMMLLinearSVR sklearn_pmml_model.svm.PMMLNuSVC sklearn_pmml_model.svm.PMMLNuSVR sklearn_pmml_model.svm.PMMLSVC sklearn_pmml_model.svm.PMMLSVR .. py:class:: PMMLLinearSVC(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseClassifier`, :py:obj:`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: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/Regression.html .. !! processed by numpydoc !! .. py:method:: fit(x, y) Not supported: PMML models are already fitted. .. !! processed by numpydoc !! .. py:method:: _more_tags() .. py:class:: PMMLLinearSVR(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseRegressor`, :py:obj:`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: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/Regression.html .. !! processed by numpydoc !! .. py:method:: fit(x, y) Not supported: PMML models are already fitted. .. !! processed by numpydoc !! .. py:method:: _more_tags() .. py:class:: PMMLNuSVC(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseClassifier`, :py:obj:`sklearn_pmml_model.svm._base.PMMLBaseSVM`, :py:obj:`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: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html .. !! processed by numpydoc !! .. py:method:: _prepare_data(X) .. py:method:: decision_function(X, *args, **kwargs) Evaluate the decision function for the samples in X. :Parameters: **X** : array-like of shape (n_samples, n_features) The input samples. :Returns: **X** : ndarray 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). .. rubric:: 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. .. !! processed by numpydoc !! .. py:method:: fit(x, y) Not supported: PMML models are already fitted. .. !! processed by numpydoc !! .. py:method:: _more_tags() .. py:class:: PMMLNuSVR(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseRegressor`, :py:obj:`sklearn_pmml_model.svm._base.PMMLBaseSVM`, :py:obj:`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: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html .. !! processed by numpydoc !! .. py:method:: _prepare_data(X) .. py:method:: fit(x, y) Not supported: PMML models are already fitted. .. !! processed by numpydoc !! .. py:method:: _more_tags() .. py:class:: PMMLSVC(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseClassifier`, :py:obj:`sklearn_pmml_model.svm._base.PMMLBaseSVM`, :py:obj:`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: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html .. !! processed by numpydoc !! .. py:method:: _prepare_data(X) .. py:method:: decision_function(X, *args, **kwargs) Evaluate the decision function for the samples in X. :Parameters: **X** : array-like of shape (n_samples, n_features) The input samples. :Returns: **X** : ndarray 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). .. rubric:: 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. .. !! processed by numpydoc !! .. py:method:: fit(x, y) Not supported: PMML models are already fitted. .. !! processed by numpydoc !! .. py:method:: _more_tags() .. py:class:: PMMLSVR(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseRegressor`, :py:obj:`sklearn_pmml_model.svm._base.PMMLBaseSVM`, :py:obj:`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: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/SupportVectorMachine.html .. !! processed by numpydoc !! .. py:method:: _prepare_data(X) .. py:method:: fit(x, y) Not supported: PMML models are already fitted. .. !! processed by numpydoc !! .. py:method:: _more_tags()