ó
    §ñ:i´  ã                   ó´   • S r SSKJr  SSKrSSKJr  SSKJrJ	r	J
r
  SSKJr  SSKJrJr  \
" S	S
/S	/\	" SS15      /S/\" \SSSS9/S.SS9SSSS.S j5       rg)z!Determination of parameter boundsé    )ÚRealNé   )ÚLabelBinarizer)ÚIntervalÚ
StrOptionsÚvalidate_params)Úsafe_sparse_dot)Úcheck_arrayÚcheck_consistent_lengthz
array-likezsparse matrixÚsquared_hingeÚlogÚbooleanÚneither)Úclosed)ÚXÚyÚlossÚfit_interceptÚintercept_scalingT)Úprefer_skip_nested_validationg      ð?)r   r   r   c          	      ó(  • [        U SS9n [        X5        [        SS9R                  U5      R                  n[
        R                  " [
        R                  " [        XP5      5      5      nU(       a�  [
        R                  " [
        R                  " U5      S4U[
        R                  " U5      R                  S9n[        U[        [
        R                  " XW5      5      R                  5       5      nUS:X  a  [        S5      eUS	:X  a  S
U-  $ SU-  $ )aH  Return the lowest bound for C.

The lower bound for C is computed such that for C in (l1_min_C, infinity)
the model is guaranteed not to be empty. This applies to l1 penalized
classifiers, such as LinearSVC with penalty='l1' and
linear_model.LogisticRegression with penalty='l1'.

This value is valid if class_weight parameter in fit() is not set.

Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
    Training vector, where `n_samples` is the number of samples and
    `n_features` is the number of features.

y : array-like of shape (n_samples,)
    Target vector relative to X.

loss : {'squared_hinge', 'log'}, default='squared_hinge'
    Specifies the loss function.
    With 'squared_hinge' it is the squared hinge loss (a.k.a. L2 loss).
    With 'log' it is the loss of logistic regression models.

fit_intercept : bool, default=True
    Specifies if the intercept should be fitted by the model.
    It must match the fit() method parameter.

intercept_scaling : float, default=1.0
    When fit_intercept is True, instance vector x becomes
    [x, intercept_scaling],
    i.e. a "synthetic" feature with constant value equals to
    intercept_scaling is appended to the instance vector.
    It must match the fit() method parameter.

Returns
-------
l1_min_c : float
    Minimum value for C.

Examples
--------
>>> from sklearn.svm import l1_min_c
>>> from sklearn.datasets import make_classification
>>> X, y = make_classification(n_samples=100, n_features=20, random_state=42)
>>> print(f"{l1_min_c(X, y, loss='squared_hinge', fit_intercept=True):.4f}")
0.0044
Úcsc)Úaccept_sparseéÿÿÿÿ)Ú	neg_labelé   )Údtypeg        zUIll-posed l1_min_c calculation: l1 will always select zero coefficients for this datar   g      à?g       @)r
   r   r   Úfit_transformÚTÚnpÚmaxÚabsr	   ÚfullÚsizeÚarrayr   ÚdotÚ
ValueError)r   r   r   r   r   ÚYÚdenÚbiass           ÚV/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/sklearn/svm/_bounds.pyÚl1_min_cr,      sà   € ôv 	�A UÑ+€AÜ˜AÔ!ä Ñ$×2Ñ2°1Ó5×7Ñ7€Aä
�&Š&”—’œ¨Ó-Ó.Ó
/€CÞÜ�wŠwÜ�WŠW�Q‹Z˜ˆOÐ.´b·h²hÐ?PÓ6Q×6WÑ6Wñ
ˆô �#”sœ2Ÿ6š6 !›?Ó+×/Ñ/Ó1Ó2ˆà
ˆcƒzÜð5ó
ð 	
ð ˆÓØ�S‰yÐà�S‰yÐó    )Ú__doc__Únumbersr   Únumpyr    Úpreprocessingr   Úutils._param_validationr   r   r   Úutils.extmathr	   Úutils.validationr
   r   r,   © r-   r+   Ú<module>r6      s�   ðÙ 'õ
 ã å *ß KÑ KÝ +ß Cñ à˜OÐ,Øˆ^Ù˜_¨eÐ4Ó5Ð6Ø#˜Ù& t¨Q°¸YÑGÐHñð #'ñ	ð +¸$ÐRUô Eó	ñEr-   