:py:mod:`sklearn_pmml_model.linear_model.base` ============================================== .. py:module:: sklearn_pmml_model.linear_model.base Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: sklearn_pmml_model.linear_model.base.PMMLGeneralizedLinearRegressor sklearn_pmml_model.linear_model.base.PMMLGeneralizedLinearClassifier Functions ~~~~~~~~~ .. autoapisummary:: sklearn_pmml_model.linear_model.base._get_coefficients sklearn_pmml_model.linear_model.base._get_intercept .. py:class:: PMMLGeneralizedLinearRegressor(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseRegressor` Abstract class for Generalized Linear Models (GLMs). The PMML model consists out of a element, containing a element that contains zero or more elements describing the coefficients for each parameter. Parameters are described in the element, that maps parameters to fields in the data. :Parameters: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/GeneralRegression.html .. !! processed by numpydoc !! .. py:class:: PMMLGeneralizedLinearClassifier(pmml) Bases: :py:obj:`sklearn_pmml_model.base.OneHotEncodingMixin`, :py:obj:`sklearn_pmml_model.base.PMMLBaseClassifier` Abstract class for Generalized Linear Models (GLMs). The PMML model consists out of a element, containing a element that contains zero or more elements describing the coefficients for each parameter. Parameters are described in the element, that maps parameters to fields in the data. :Parameters: **pmml** : str, object Filename or file object containing PMML data. .. rubric:: Notes Specification: http://dmg.org/pmml/v4-3/GeneralRegression.html .. !! processed by numpydoc !! .. py:function:: _get_coefficients(linear_model, model) Obtain the coefficients for the GLM regression. Raises an exception when we notice non linear parameter configurations. :Parameters: **linear_model** : PMMLGeneralizedLinearRegressor, PMMLGeneralizedLinearClassifier The PMML class representing the classifier. Should contain at least target_field, fields and field_mapping properties. **model** : eTree.Element The element that is assumed to contains a and element. :Returns: coefficients: numpy.ndarray Coefficient value for every field. Zero if not present. .. !! processed by numpydoc !! .. py:function:: _get_intercept(model) Find all parameters that are not included in the . These constitute the intercept. In the very unlikely case there are multiple parameters fitting this criteria, we sum the result. :Parameters: **model** : eTree.Element The element that is assumed to contains a and element. :Returns: **intercept** : float Value of the intercept of the method. .. !! processed by numpydoc !!