
    0Phfm                        d Z ddlZddlZddlmZmZ ddlmZ ddlZddl	m
Z ddlmZmZm
Z
 ddlmZ ddlmZ dd	lmZmZmZmZmZ dd
lmZmZ ddlmZmZmZm Z m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z' ddl(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0m1Z1m2Z2 dZ3d$dZ4ddddddZ5d%dZ6 G d dee          Z7 G d de          Z8 G d d          Z9 G d d eee7          Z:	 d&d"Z;	 	 d'd#Z<dS )(z
Generalized Linear Models.
    N)ABCMetaabstractmethod)Integral)linalgoptimizesparse)lsqr)expit   )BaseEstimatorClassifierMixinMultiOutputMixinRegressorMixin_fit_context)check_arraycheck_random_state)_asarray_with_order_averageget_namespaceget_namespace_and_deviceindexing_dtypesupported_float_dtypes)ArrayDataset32ArrayDataset64CSRDataset32CSRDataset64)safe_sparse_dot)Paralleldelayed)mean_variance_axis)_check_sample_weightcheck_is_fittedvalidate_datag{Gz?c                    t          |          }|                    dt          j        t          j                  j                  }| j        t          j        k    rt          }t          }nt          }t          }t          j        |           r( || j        | j        | j        |||          }t"          }	n%t          j        |           }  || |||          }d}	||	fS )aD  Create ``Dataset`` abstraction for sparse and dense inputs.

    This also returns the ``intercept_decay`` which is different
    for sparse datasets.

    Parameters
    ----------
    X : array-like, shape (n_samples, n_features)
        Training data

    y : array-like, shape (n_samples, )
        Target values.

    sample_weight : numpy array of shape (n_samples,)
        The weight of each sample

    random_state : int, RandomState instance or None (default)
        Determines random number generation for dataset random sampling. It is not
        used for dataset shuffling.
        Pass an int for reproducible output across multiple function calls.
        See :term:`Glossary <random_state>`.

    Returns
    -------
    dataset
        The ``Dataset`` abstraction
    intercept_decay
        The intercept decay
       )seedg      ?)r   randintnpiinfoint32maxdtypefloat32r   r   r   r   spissparsedataindptrindicesSPARSE_INTERCEPT_DECAYascontiguousarray)
Xysample_weightrandom_staterngr&   CSRData	ArrayDatadatasetintercept_decays
             Z/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sklearn/linear_model/_base.pymake_datasetr?   6   s    > \
*
*C;;q"(28,,011Dw"*"		"		{1~~ '!&!(AIq-dSSS0 ##)Aq-d;;;O##    T)copycopy_yr7   check_inputc                   t          | ||          \  }}}	| j        \  }
}t          j        |           }t	          |t
          j                  rd}||                    |          }|r;t          | |ddgt          |                    } t          || j
        |d          }nI|                    || j
        |          }|r*|r|                                 } nt          | dd	|
          } | j
        }|rf|rt          | d|          \  }}n5t          | d||          }|                    || j
        d          }| |z  } t          |d||          }||z  }nd|                    || j
        |	          }|j        dk    r|                    d||	          }n#|                    |j        d         ||	          }|                    || j
        |	          }| ||||fS )a  Common data preprocessing for fitting linear models.

    This helper is in charge of the following steps:

    - Ensure that `sample_weight` is an array or `None`.
    - If `check_input=True`, perform standard input validation of `X`, `y`.
    - Perform copies if requested to avoid side-effects in case of inplace
      modifications of the input.

    Then, if `fit_intercept=True` this preprocessing centers both `X` and `y` as
    follows:
        - if `X` is dense, center the data and
        store the mean vector in `X_offset`.
        - if `X` is sparse, store the mean in `X_offset`
        without centering `X`. The centering is expected to be handled by the
        linear solver where appropriate.
        - in either case, always center `y` and store the mean in `y_offset`.
        - both `X_offset` and `y_offset` are always weighted by `sample_weight`
          if not set to `None`.

    If `fit_intercept=False`, no centering is performed and `X_offset`, `y_offset`
    are set to zero.

    Returns
    -------
    X_out : {ndarray, sparse matrix} of shape (n_samples, n_features)
        If copy=True a copy of the input X is triggered, otherwise operations are
        inplace.
        If input X is dense, then X_out is centered.
    y_out : {ndarray, sparse matrix} of shape (n_samples,) or (n_samples, n_targets)
        Centered version of y. Possibly performed inplace on input y depending
        on the copy_y parameter.
    X_offset : ndarray of shape (n_features,)
        The mean per column of input X.
    y_offset : float or ndarray of shape (n_features,)
    X_scale : ndarray of shape (n_features,)
        Always an array of ones. TODO: refactor the code base to make it
        possible to remove this unused variable.
    Ncsrcsc)rA   accept_sparser,   F)r,   rA   	ensure_2drA   KT)orderrA   xpr   )axisweights)rM   rN   rL   )r,   devicer%           )r   shaper.   r/   
isinstancenumbersNumberasarrayr   r   r,   astyperA   r   r    r   zerosndimones)r5   r6   fit_interceptrA   rB   r7   rC   rL   _device_	n_samples
n_featuresX_is_sparsedtype_X_offsetX_vary_offsetX_scales                     r>   _preprocess_datare   k   s   b .aMBBNB7GIz+a..K-00  

=11 HD>TUW>X>X
 
 
 vGGGIIavI.. 	H HFFHH'4BGGGWF J 	0MRRROHee=RHHHHyy17y??HMAAA}DDD	X88Jagg8FF6Q;;zz#VGzDDHHxx
&xIIH ggjg@@Ga8W,,r@   Fc                 X   t          | ||          \  }}| j        d         }|                    |          }t          j        |           st          j        |          rt          j        |df||f          }t          j        |           rt          ||           } n!|r| |dddf         z  } n| |dddf         z  } t          j        |          rt          ||          }nC|r!|j        dk    r||z  }n0||dddf         z  }n |j        dk    r||z  }n||dddf         z  }| ||fS )a  Rescale data sample-wise by square root of sample_weight.

    For many linear models, this enables easy support for sample_weight because

        (y - X w)' S (y - X w)

    with S = diag(sample_weight) becomes

        ||y_rescaled - X_rescaled w||_2^2

    when setting

        y_rescaled = sqrt(S) y
        X_rescaled = sqrt(S) X

    Returns
    -------
    X_rescaled : {array-like, sparse matrix}

    y_rescaled : {array-like, sparse matrix}
    r   )rQ   Nr%   )	r   rQ   sqrtr.   r/   r   
dia_matrixr   rX   )	r5   r6   r7   inplacerL   r[   r]   sample_weight_sqrt	sw_matrixs	            r>   _rescale_datarl      sq   0 !Q..EB
I//	{1~~ 
Q 
%#Iy+A
 
 
	 
{1~~ 0Iq)) 	0#AAAtG,,AA&qqq$w//A	{1~~ 4Iq)) 		4v{{'''400v{{***111d733a###r@   c                   :    e Zd ZdZed             Zd Zd Zd ZdS )LinearModelzBase class for Linear Modelsc                     dS )z
Fit model.N )selfr5   r6   s      r>   fitzLinearModel.fit  s      r@   c                     t          |            t          | |g dd          }| j        }|j        dk    r||z  | j        z   S ||j        z  | j        z   S )NrE   rF   cooFrG   resetr%   )r"   r#   coef_rX   
intercept_T)rq   r5   rx   s      r>   _decision_functionzLinearModel._decision_function  sc    $1F1F1FeTTT
:??u9t..uw;00r@   c                 ,    |                      |          S )a!  
        Predict using the linear model.

        Parameters
        ----------
        X : array-like or sparse matrix, shape (n_samples, n_features)
            Samples.

        Returns
        -------
        C : array, shape (n_samples,)
            Returns predicted values.
        )r{   )rq   r5   s     r>   predictzLinearModel.predict  s     &&q)))r@   c                    t          |||          \  }}| j        ri|                    | j        |j        d          }|                    ||          x}| _        |j        dk    r	|||z  z
  }n|||j        z  z
  }|| _        dS d| _        dS )zSet the intercept_FrI   r%   rP   N)	r   rZ   rV   rx   r,   dividerX   rz   ry   )rq   ra   rc   rd   rL   r[   rx   ry   s           r>   _set_interceptzLinearModel._set_intercept+  s     h'::A 	" IIdj'-eIDDE!#5'!:!::EDJzQ%5(88

%57(::
(DOOO "DOOOr@   N)	__name__
__module____qualname____doc__r   rr   r{   r}   r   rp   r@   r>   rn   rn   
  s`        &&  ^1 1 1* * * " " " " "r@   rn   )	metaclassc                   $    e Zd ZdZd Zd Zd ZdS )LinearClassifierMixinzRMixin for linear classifiers.

    Handles prediction for sparse and dense X.
    c                    t          |            t          |          \  }}t          | |dd          }t          || j        j        d          | j        z   }|j        dk    r'|j        d         dk    r|	                    |d          n|S )a  
        Predict confidence scores for samples.

        The confidence score for a sample is proportional to the signed
        distance of that sample to the hyperplane.

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape (n_samples, n_features)
            The data matrix for which we want to get the confidence scores.

        Returns
        -------
        scores : ndarray of shape (n_samples,) or (n_samples, n_classes)
            Confidence scores per `(n_samples, n_classes)` combination. In the
            binary case, confidence score for `self.classes_[1]` where >0 means
            this class would be predicted.
        rE   Frv   T)dense_outputr%   ))
r"   r   r#   r   rx   rz   ry   rX   rQ   reshape)rq   r5   rL   r[   scoress        r>   decision_functionz'LinearClassifierMixin.decision_functionI  s    & 	a  A$eDDD DJLtDDDtV aFLOq$8$8 JJvu%%%	
r@   c                 8   t          |          \  }}|                     |          }t          |j                  dk    r(|                    |dk    t          |                    }n|                    |d          }|                    | j        |d          S )a~  
        Predict class labels for samples in X.

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape (n_samples, n_features)
            The data matrix for which we want to get the predictions.

        Returns
        -------
        y_pred : ndarray of shape (n_samples,)
            Vector containing the class labels for each sample.
        r%   r   rM   )	r   r   lenrQ   rV   r   argmaxtakeclasses_)rq   r5   rL   r[   r   r2   s         r>   r}   zLinearClassifierMixin.predictg  s     a  A''**v|!!ii
N2,>,>??GGiiQi//Gwwt}gAw666r@   c                    |                      |          }t          ||           |j        dk    rt          j        d|z
  |g          j        S ||                    d                              |j        d         df          z  }|S )zProbability estimation for OvR logistic regression.

        Positive class probabilities are computed as
        1. / (1. + np.exp(-self.decision_function(X)));
        multiclass is handled by normalizing that over all classes.
        outr%   r   r   r   )	r   r
   rX   r(   vstackrz   sumr   rQ   )rq   r5   probs      r>   _predict_proba_lrz'LinearClassifierMixin._predict_proba_lr~  s     %%a((d9>>9a$h-..00 DHH!H$$,,djmR-@AAADKr@   N)r   r   r   r   r   r}   r   rp   r@   r>   r   r   C  sK         

 
 
<7 7 7.    r@   r   c                       e Zd ZdZd Zd ZdS )SparseCoefMixinzlMixin for converting coef_ to and from CSR format.

    L1-regularizing estimators should inherit this.
    c                     d}t          | |           t          j        | j                  r| j                                        | _        | S )a  
        Convert coefficient matrix to dense array format.

        Converts the ``coef_`` member (back) to a numpy.ndarray. This is the
        default format of ``coef_`` and is required for fitting, so calling
        this method is only required on models that have previously been
        sparsified; otherwise, it is a no-op.

        Returns
        -------
        self
            Fitted estimator.
        z6Estimator, %(name)s, must be fitted before densifying.msg)r"   r.   r/   rx   toarrayrq   r   s     r>   densifyzSparseCoefMixin.densify  sK     G#&&&&;tz"" 	.++--DJr@   c                 h    d}t          | |           t          j        | j                  | _        | S )a  
        Convert coefficient matrix to sparse format.

        Converts the ``coef_`` member to a scipy.sparse matrix, which for
        L1-regularized models can be much more memory- and storage-efficient
        than the usual numpy.ndarray representation.

        The ``intercept_`` member is not converted.

        Returns
        -------
        self
            Fitted estimator.

        Notes
        -----
        For non-sparse models, i.e. when there are not many zeros in ``coef_``,
        this may actually *increase* memory usage, so use this method with
        care. A rule of thumb is that the number of zero elements, which can
        be computed with ``(coef_ == 0).sum()``, must be more than 50% for this
        to provide significant benefits.

        After calling this method, further fitting with the partial_fit
        method (if any) will not work until you call densify.
        z7Estimator, %(name)s, must be fitted before sparsifying.r   )r"   r.   
csr_matrixrx   r   s     r>   sparsifyzSparseCoefMixin.sparsify  s5    4 H#&&&&]4:..
r@   N)r   r   r   r   r   r   rp   r@   r>   r   r     s<         
  (    r@   r   c                        e Zd ZU dZdgdgdegdgdZeed<   ddddddZ e	d	          dd
            Z
 fdZ xZS )LinearRegressionaj  
    Ordinary least squares Linear Regression.

    LinearRegression fits a linear model with coefficients w = (w1, ..., wp)
    to minimize the residual sum of squares between the observed targets in
    the dataset, and the targets predicted by the linear approximation.

    Parameters
    ----------
    fit_intercept : bool, default=True
        Whether to calculate the intercept for this model. If set
        to False, no intercept will be used in calculations
        (i.e. data is expected to be centered).

    copy_X : bool, default=True
        If True, X will be copied; else, it may be overwritten.

    n_jobs : int, default=None
        The number of jobs to use for the computation. This will only provide
        speedup in case of sufficiently large problems, that is if firstly
        `n_targets > 1` and secondly `X` is sparse or if `positive` is set
        to `True`. ``None`` means 1 unless in a
        :obj:`joblib.parallel_backend` context. ``-1`` means using all
        processors. See :term:`Glossary <n_jobs>` for more details.

    positive : bool, default=False
        When set to ``True``, forces the coefficients to be positive. This
        option is only supported for dense arrays.

        .. versionadded:: 0.24

    Attributes
    ----------
    coef_ : array of shape (n_features, ) or (n_targets, n_features)
        Estimated coefficients for the linear regression problem.
        If multiple targets are passed during the fit (y 2D), this
        is a 2D array of shape (n_targets, n_features), while if only
        one target is passed, this is a 1D array of length n_features.

    rank_ : int
        Rank of matrix `X`. Only available when `X` is dense.

    singular_ : array of shape (min(X, y),)
        Singular values of `X`. Only available when `X` is dense.

    intercept_ : float or array of shape (n_targets,)
        Independent term in the linear model. Set to 0.0 if
        `fit_intercept = False`.

    n_features_in_ : int
        Number of features seen during :term:`fit`.

        .. versionadded:: 0.24

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X`
        has feature names that are all strings.

        .. versionadded:: 1.0

    See Also
    --------
    Ridge : Ridge regression addresses some of the
        problems of Ordinary Least Squares by imposing a penalty on the
        size of the coefficients with l2 regularization.
    Lasso : The Lasso is a linear model that estimates
        sparse coefficients with l1 regularization.
    ElasticNet : Elastic-Net is a linear regression
        model trained with both l1 and l2 -norm regularization of the
        coefficients.

    Notes
    -----
    From the implementation point of view, this is just plain Ordinary
    Least Squares (scipy.linalg.lstsq) or Non Negative Least Squares
    (scipy.optimize.nnls) wrapped as a predictor object.

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.linear_model import LinearRegression
    >>> X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]])
    >>> # y = 1 * x_0 + 2 * x_1 + 3
    >>> y = np.dot(X, np.array([1, 2])) + 3
    >>> reg = LinearRegression().fit(X, y)
    >>> reg.score(X, y)
    1.0
    >>> reg.coef_
    array([1., 2.])
    >>> reg.intercept_
    np.float64(3.0...)
    >>> reg.predict(np.array([[3, 5]]))
    array([16.])
    booleanNrZ   copy_Xn_jobspositive_parameter_constraintsTFc                >    || _         || _        || _        || _        d S Nr   )rq   rZ   r   r   r   s        r>   __init__zLinearRegression.__init__0  s%     + r@   )prefer_skip_nested_validationc           	         | j         }| j        rdng d}t          | |ddd          \  |du}|rt          |j        d          }| j        ot          j                   }t          | j	        ||          \  }}	}
|rt          ||          \  | j        rj        d	k     r"t          j                  d
         | _        n t          |          fdt!          j        d                   D                       }t%          j        d |D                       | _        nUt          j                  r||
z  |rfd}fd}nfd}fd}t(          j                            j        ||          j        d	k     rt/                    d
         | _        n t          |          fdt!          j        d                   D                       }t%          j        d |D                       | _        not1          j                  t%          j        j                  j        z  }t+          j        |          \  | _        }| _        | _        | j        j        | _        j        dk    rt%          j        | j                  | _        |                      ||	|
           | S )ap  
        Fit linear model.

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape (n_samples, n_features)
            Training data.

        y : array-like of shape (n_samples,) or (n_samples, n_targets)
            Target values. Will be cast to X's dtype if necessary.

        sample_weight : array-like of shape (n_samples,), default=None
            Individual weights for each sample.

            .. versionadded:: 0.17
               parameter *sample_weight* support to LinearRegression.

        Returns
        -------
        self : object
            Fitted Estimator.
        Frt   T)rG   	y_numericmulti_outputforce_writeableN)r,   ensure_non_negative)rZ   rA   r7   )ri   r   r   )r   c              3   r   K   | ]1} t          t          j                  d d |f                   V  2d S r   )r   r   nnls).0jr5   r6   s     r>   	<genexpr>z'LinearRegression.fit.<locals>.<genexpr>  sW       0 0;<*GHM**1a1g660 0 0 0 0 0r@   r%   c                     g | ]
}|d          S r   rp   r   r   s     r>   
<listcomp>z(LinearRegression.fit.<locals>.<listcomp>      '?'?'?3A'?'?'?r@   c                 `                         |           |                                z  z
  S r   dotbr5   X_offset_scalerj   s    r>   matvecz$LinearRegression.fit.<locals>.matvec  s*    5588&8155;P;P&PPPr@   c                 j    j                             |           |                               z  z
  S r   )rz   r   r   s    r>   rmatvecz%LinearRegression.fit.<locals>.rmatvec  s,    3771::?Q9R9R(RRRr@   c                 Z                         |           |                                z
  S r   r   r   r5   r   s    r>   r   z$LinearRegression.fit.<locals>.matvec  s$    5588aeeN&;&;;;r@   c                 h    j                             |           |                                 z  z
  S r   )rz   r   r   r   s    r>   r   z%LinearRegression.fit.<locals>.rmatvec  s'    3771::(@@@r@   )rQ   r   r   c              3      K   | ]>} t          t                    d d |f                                                   V  ?d S r   )r   r	   ravel)r   r   
X_centeredr6   s     r>   r   z'LinearRegression.fit.<locals>.<genexpr>  s]       0 0 "GDMM*a1gmmoo>>0 0 0 0 0 0r@   c                     g | ]
}|d          S r   rp   r   s     r>   r   z(LinearRegression.fit.<locals>.<listcomp>  r   r@   )cond)!r   r   r#   r!   r,   r   r.   r/   re   rZ   rl   rX   r   r   rx   r   rangerQ   r(   r   r   r   LinearOperatorr	   r+   finfoepslstsqrank_	singular_rz   r   r   )rq   r5   r6   r7   n_jobs_rG   has_swcopy_X_in_preprocess_datara   rc   rd   outsr   r   r   r[   r   r   rj   s    ``             @@@r>   rr   zLinearRegression.fit=  s   0 +!%I4I4I4I' 
 
 
1 d* 	0qT  M %)K$FA4F!,<,*'-
 -
 -
)1h'  	 (51m-F( ( ($Aq$ = -	&vzz%]1a003

 0xw/// 0 0 0 0 0@Eagaj@Q@Q0 0 0    Y'?'?$'?'?'?@@

[^^ $	&%/N AQ Q Q Q Q Q QS S S S S S S S
< < < < < <A A A A A A  55gfg 6  J vzz!*a003

 0xw/// 0 0 0 0 0"171:..0 0 0    Y'?'?$'?'?'?@@

 qw<<"(17"3"3"77D8>QPT8U8U8U5DJ4:t~DJ6Q;;$*--DJHh888r@   c                 l    t                                                      }| j         |j        _        |S r   )super__sklearn_tags__r   
input_tagsr   )rq   tags	__class__s     r>   r   z!LinearRegression.__sklearn_tags__  s,    ww''))%)]!2r@   r   )r   r   r   r   r   r   dict__annotations__r   r   rr   r   __classcell__)r   s   @r>   r   r     s         ] ]@ $+"K	$ $D    ! ! ! ! ! \555r r r 65rh        r@   r   h㈵>c                    | j         d         }|dz  }t          |dz   |dz
            }| dd|f         ||         z
  ||         z  }	| dd|f         ||         z
  ||         z  }
t          j        |	|
          }|||f         }|j        |j        g}|d |D             }t          |          }t          j        ||||          st          d| d| d| d	| d
	          dS )a^  Computes a single element of the gram matrix and compares it to
    the corresponding element of the user supplied gram matrix.

    If the values do not match a ValueError will be thrown.

    Parameters
    ----------
    X : ndarray of shape (n_samples, n_features)
        Data array.

    precompute : array-like of shape (n_features, n_features)
        User-supplied gram matrix.

    X_offset : ndarray of shape (n_features,)
        Array of feature means used to center design matrix.

    X_scale : ndarray of shape (n_features,)
        Array of feature scale factors used to normalize design matrix.

    rtol : float, default=None
        Relative tolerance; see numpy.allclose
        If None, it is set to 1e-4 for arrays of dtype numpy.float32 and 1e-7
        otherwise.

    atol : float, default=1e-5
        absolute tolerance; see :func`numpy.allclose`. Note that the default
        here is more tolerant than the default for
        :func:`numpy.testing.assert_allclose`, where `atol=0`.

    Raises
    ------
    ValueError
        Raised when the provided Gram matrix is not consistent.
    r%   r   Nc                 6    g | ]}|t           j        k    rd ndS )g-C6?gHz>)r(   r-   )r   r,   s     r>   r   z2_check_precomputed_gram_matrix.<locals>.<listcomp>  s(    KKK5"*,,$KKKr@   )rtolatolzGram matrix passed in via 'precompute' parameter did not pass validation when a single element was checked - please check that it was computed properly. For element (,z) we computed z! but the user-supplied value was .)rQ   minr(   r   r,   r+   isclose
ValueError)r5   
precomputera   rd   r   r   r^   f1f2v1v2expectedactualdtypesrtolss                  r>   _check_precomputed_gram_matrixr     sB   L J	qB	R!VZ!^	$	$B
AAArE(Xb\
!WR[	0B
AAArE(Xb\
!WR[	0Bvb"~~HBF/F|KKFKKK5zz:hT=== 
 ')  ,.  	 
   
 
 	

 
r@   c                    | j         \  }}	t          j        |           rd}t          | ||d||          \  } }}
}}n3t          | |||||          \  } }}
}}|t	          | ||          \  } }}t          |d          r\|rFt          j        |
t          j        |	                    st          j
        dt                     d}d}n|rt          | ||
|           t          |t                    r|dk    r||	k    }|du r:t          j        |	|	f| j        d	
          }t          j        | j        | |           t          |d          sd}t          |d          r|t          j        | j        |j                  }|j        dk    r4t          j        |	|d	
          }t          j        | j        ||           nG|j         d         }t          j        |	|f|d
          }t          j        |j        | |j                   | ||
||||fS )zFunction used at beginning of fit in linear models with L1 or L0 penalty.

    This function applies _preprocess_data and additionally computes the gram matrix
    `precompute` as needed as well as `Xy`.
    F)rZ   rA   rC   r7   N)r7   	__array__zVGram matrix was provided but X was centered to fit intercept: recomputing Gram matrix.autoTC)rQ   r,   rK   r   r%   F)rQ   r   r/   re   rl   hasattrr(   allcloserW   warningswarnUserWarningr   rR   stremptyr,   r   rz   result_typerX   )r5   r6   Xyr   rZ   rA   rC   r7   r]   r^   ra   rc   rd   r[   common_dtype	n_targetss                   r>   _pre_fitr
    sw    GIzq G
,<'#'-
 -
 -
)1h'' -='#'-
 -
 -
)1h' $#AqFFFGAq!z;'' M 	MXrx
7K7K!L!L 	MM:     JBB 	M +1j(GLLL *c"" ,zV';';+
TXZ$<AGSVWWW

qsA:&&&&:{++ z;'' %BJ~agqw776Q;;
,cJJJBF13r"""""
 
IY 7|SVWWWBF13rt$$$$a8Wj"<<r@   r   )F)Nr   )TN)=r   rS   r  abcr   r   r   numpyr(   scipy.sparser   r.   scipyr   r   scipy.sparse.linalgr	   scipy.specialr
   baser   r   r   r   r   utilsr   r   utils._array_apir   r   r   r   r   r   utils._seq_datasetr   r   r   r   utils.extmathr   utils.parallelr   r   utils.sparsefuncsr    utils.validationr!   r"   r#   r3   r?   re   rl   rn   r   r   r   r   r
  rp   r@   r>   <module>r     s`      ' ' ' ' ' ' ' '                 * * * * * * * * * * $ $ $ $ $ $                    4 3 3 3 3 3 3 3                           , + + + + + . . . . . . . . 2 2 2 2 2 2 S S S S S S S S S S
  
2$ 2$ 2$ 2$t 
^- ^- ^- ^- ^-L6$ 6$ 6$ 6$r4" 4" 4" 4" 4"-7 4" 4" 4" 4"rI I I I IO I I IX7 7 7 7 7 7 7 7tl l l l l' l l l` 7;=
 =
 =
 =
N Z= Z= Z= Z= Z= Z=r@   