sklearn_pmml_model.svm._base ============================ .. py:module:: sklearn_pmml_model.svm._base Classes ------- .. autoapisummary:: sklearn_pmml_model.svm._base.PMMLBaseSVM Functions --------- .. autoapisummary:: sklearn_pmml_model.svm._base.get_vectors sklearn_pmml_model.svm._base.get_alt_svms sklearn_pmml_model.svm._base.get_overlapping_vectors sklearn_pmml_model.svm._base.get_coefficients Module Contents --------------- .. py:class:: PMMLBaseSVM Abstract class for Support Vector Machines. The PMML model consists out of a element, containing a element that contains a element describing support vectors, and a element describing the coefficients for each support vector. Support vectors are referenced from a element, in which the true support vectors are described using elements. Furthermore, the model contains one out of , , or describing the kernel function used. :Parameters: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/SupportVectorMachineModel.html .. !! processed by numpydoc !! .. py:attribute:: shape_fit_ .. py:attribute:: support_ .. py:attribute:: _n_support .. py:attribute:: support_vectors_ .. py:attribute:: _probA .. py:attribute:: _probB .. py:function:: get_vectors(vector_dictionary, s) Return support vector values, parsed as a numpy array. .. !! processed by numpydoc !! .. py:function:: get_alt_svms(svms, classes, target_class) Find alternative SVMs (e.g., for target class 0, find the svms classifying 0 against 1, and 0 against 2). :Parameters: **svms** : list List of eTree.Element objects describing the different one-to-one support vector machines in the PMML. **classes** : numpy.array The classes to be predicted by the model. **target_class** : str The target class. :Returns: **alt_svms** : list List of eTree.Elements filtered to only include SVMs comparing the target class against alternate classes. .. !! processed by numpydoc !! .. py:function:: get_overlapping_vectors(svms) Return support vector ids that are present in all provided SVM elements. :Parameters: **svms** : list List of eTree.Element objects describing the different one-to-one support vector machines in the PMML. :Returns: **output** : set Set containing all integer vector ids that are present in all provided SVM elements. .. !! processed by numpydoc !! .. py:function:: get_coefficients(classes, n_support, support_ids, svms) Return support vector coefficients. :Parameters: **classes** : numpy.array The classes to be predicted by the model. **n_support** : numpy.array Numpy array describing the number of support vectors for each class. **support_ids: list** A list describing the ids of all support vectors in the model. **svms** : list List of eTree.Element objects describing the different one-to-one support vector machines in the PMML. .. !! processed by numpydoc !!