§
    rŠtjõ¯  ã                   óŽ  — d dl Z d dlmZmZ d dlmZ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mZ d dlmZ d dl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$m%Z% d dl&m'Z' d dl(m)Z) d dl*m+Z+ d dl,m-Z- d dl.m/Z/m0Z0 d dl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7 g d¢Z8d„ Z9 G d„ dee¬¦  «        Z: G d„ dee:e¬¦  «        Z;d„ Z<	 	 	 	 	 dd„Z=dS )é    N)ÚABCMetaÚabstractmethod)ÚIntegralÚReal)ÚBaseEstimatorÚClassifierMixinÚ_fit_context)ÚConvergenceWarningÚNotFittedError)ÚLabelEncoder)Ú
_liblinear)Ú_libsvm)Ú_libsvm_sparse)Úcheck_arrayÚcheck_random_stateÚcolumn_or_1dÚcompute_class_weightÚ
deprecated)ÚHiddenÚIntervalÚ
StrOptions)Ú_align_api_if_sparse)Úsafe_sparse_dot)ÚSCIPY_VERSION_BELOW_1_12)Úavailable_if)Ú_ovr_decision_functionÚcheck_classification_targets)Ú_check_large_sparseÚ_check_sample_weightÚ_num_samplesÚcheck_consistent_lengthÚcheck_is_fittedÚvalidate_data)Úc_svcÚnu_svcÚ	one_classÚepsilon_svrÚnu_svrc           	      ó¤  — | j         d         dz   }g }t          j        t          j        dg|g¦  «        ¦  «        }t	          |¦  «        D �]}|||         ||dz            …dd…f         }t	          |dz   |¦  «        D ]Ï}|||         ||dz            …dd…f         }	t
          r<| |dz
  g||         ||dz            …f         }
| |g||         ||dz            …f         }n9| |dz
  ||         ||dz            …f         }
| |||         ||dz            …f         }|                     t          |
|¦  «        t          ||	¦  «        z   ¦  «         ŒÐ�Œ|S )z�Generate primal coefficients from dual coefficients
    for the one-vs-one multi class LibSVM in the case
    of a linear kernel.r   é   N)ÚshapeÚnpÚcumsumÚhstackÚranger   Úappendr   )Ú	dual_coefÚ	n_supportÚsupport_vectorsÚn_classÚcoefÚsv_locsÚclass1Úsv1Úclass2Úsv2Úalpha1Úalpha2s               úO/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sklearn/svm/_base.pyÚ_one_vs_one_coefr>   0   s™  € ð Œo˜aÔ  1Ñ$€Gð €DÝŒi�œ	 A 3¨	Ð"2Ñ3Ô3Ñ4Ô4€GÝ˜‘.”.ð Uñ Uˆà˜g fœo°¸À¹
Ô0CÐCÀQÀQÀQÐFÔGˆÝ˜F Q™J¨Ñ0Ô0ð 	Uð 	UˆFà! '¨&¤/°G¸FÀQ¹JÔ4GÐ"GÈÈÈÐ"JÔKˆCå'ð 	Rà" F¨Q¡J <°¸´À7È6ÐTUÉ:ÔCVÐ1VÐ#VÔW�à" F 8¨W°V¬_¸wÀvÐPQÁzÔ?RÐ-RÐ#RÔS��ð # 6¨A¡:¨w°v¬ÀÈÐRSÉÔATÐ/TÐ#TÔU�à" 6¨7°6¬?¸WÀVÈaÁZÔ=PÐ+PÐ#PÔQ�ð �KŠK�¨°Ñ4Ô4µÀvÈsÑ7SÔ7SÑSÑTÔTÐTÐTñ!	Uð" €Kó    c                   óŽ  ‡ — e Zd ZU dZ eh d£¦  «        eg eeddd¬¦  «        g eddh¦  «         eed	dd¬¦  «        g eeddd
¬¦  «        g eed	dd
¬¦  «        g eed	dd¬¦  «        g eed	dd¬¦  «        g eed	dd¬¦  «        gdgd e	 edh¦  «        ¦  «        g eeddd
¬¦  «        g edh¦  «        e
dgdg eeddd¬¦  «        gdgdœZe
ed<   g d¢Zed„ ¦   «         Zˆ fd„Z ed¬¦  «        d*d„¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd „ Zd!„ Zd"„ Zd#„ Zd$„ Zd%„ Zd&„ Zed'„ ¦   «         Z d(„ Z!ed)„ ¦   «         Z"ˆ xZ#S )+Ú
BaseLibSVMzÉBase class for estimators that use libsvm as backing library.

    This implements support vector machine classification and regression.

    Parameter documentation is in the derived `SVC` class.
    >   ÚrbfÚpolyÚlinearÚsigmoidÚprecomputedr   NÚleft)ÚclosedÚscaleÚautoç        ÚneitherÚrightç      ð?Úbooleanr   ÚbalancedÚverboseéÿÿÿÿÚrandom_state©ÚkernelÚdegreeÚgammaÚcoef0ÚtolÚCÚnuÚepsilonÚ	shrinkingÚprobabilityÚ
cache_sizeÚclass_weightrQ   Úmax_iterrS   Ú_parameter_constraints)rD   rC   rB   rE   rF   c                 ó4  — | j         t          vr t          dt          ›d| j         ›d�¦  «        ‚|| _        || _        || _        || _        || _        || _        || _	        || _
        |	| _        |
| _        || _        || _        || _        || _        || _        d S )Nzimpl should be one of z, z
 was given)Ú_implÚLIBSVM_IMPLÚ
ValueErrorrU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   rQ   ra   rS   )ÚselfrU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   rQ   ra   rS   s                   r=   Ú__init__zBaseLibSVM.__init__{   s«   € ð& Œ:�[Ð(Ð(Ý�*Ý<G¸K¸KÈÌÈÈÐTñô ð ð ˆŒØˆŒØˆŒ
ØˆŒ
ØˆŒØˆŒØˆŒØˆŒØ"ˆŒØ&ˆÔØ$ˆŒØ(ˆÔØˆŒØ ˆŒØ(ˆÔÐÐr?   c                 óœ   •— t          ¦   «                              ¦   «         }| j        dk    |j        _        | j        dk    |j        _        |S ©NrF   )ÚsuperÚ__sklearn_tags__rU   Ú
input_tagsÚpairwiseÚsparse©rg   ÚtagsÚ	__class__s     €r=   rl   zBaseLibSVM.__sklearn_tags__£   s?   ø€ Ý‰wŒw×'Ò'Ñ)Ô)ˆà#'¤;°-Ò#?ˆŒÔ Ø!%¤°Ò!=ˆŒÔØˆr?   T)Úprefer_skip_nested_validationc           	      óÚ	  — t          | j        ¦  «        }t          j        |¦  «        }|r| j        dk    rt          d¦  «        ‚|ot          | j        ¦  «         | _        t          | j        ¦  «        rt          ||¦  «         n#t          | ||t          j        ddd¬¦  «        \  }}|                      |¦  «        }t          j        |€g n|t          j        ¬¦  «        }t                               | j        ¦  «        }| j        | _        | j        d	v rD| j        d
k    rd}nd}| j        dk    r"t'          j        d|› d|› d�t*          ¦  «         nd| _        t-          |¦  «        }|dk    r5||j        d         k    r$t1          dd|›d|j        d         ›d�z   ¦  «        ‚| j        dk    rJ||j        d         k    r9t1          d                     |j        d         |j        d         ¦  «        ¦  «        ‚|j        d         dk    r1|j        d         |k    r t1          d|j        ›d|j        ›d�¦  «        ‚t          | j        ¦  «        rdn| j        }	|	dk    rd| _        nât7          | j        t:          ¦  «        r¢| j        dk    rv|r?|                     |¦  «                             ¦   «         |                     ¦   «         dz  z
  n|                      ¦   «         }
|
dk    rd|j        d         |
z  z  nd| _        nG| j        dk    rd|j        d         z  | _        n&t7          | j        tB          ¦  «        r| j        | _        | j        r| j"        n| j#        }| j$        rtK          d d!¬"¦  «         | &                    t          j'        d#¦  «        j(        ¦  «        } ||||||	|¬$¦  «         tS          |d%¦  «        r|j        n|f| _*        | j+         ,                    ¦   «         | _-        | j.        | _/        | j        d	v r5ta          | j1        ¦  «        dk    r| xj+        d&z  c_+        | j.         | _.        | j        r| j/        j2        n| j/        }t          j3        | j-        ¦  «         4                    ¦   «         }t          j3        |¦  «         4                    ¦   «         }|r|st1          d'¦  «        ‚| j        d	v r| j5        | _6        n| j5         7                    ¦   «         | _6        | S )(a�  Fit the SVM model according to the given training data.

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape (n_samples, n_features)                 or (n_samples, n_samples)
            Training vectors, where `n_samples` is the number of samples
            and `n_features` is the number of features.
            For kernel="precomputed", the expected shape of X is
            (n_samples, n_samples).

        y : array-like of shape (n_samples,)
            Target values (class labels in classification, real numbers in
            regression).

        sample_weight : array-like of shape (n_samples,), default=None
            Per-sample weights. Rescale C per sample. Higher weights
            force the classifier to put more emphasis on these points.

        Returns
        -------
        self : object
            Fitted estimator.

        Notes
        -----
        If X and y are not C-ordered and contiguous arrays of np.float64 and
        X is not a sparse CSR format, X and/or y may be copied.

        If X is a dense array, then the other methods will not support sparse
        matrices as input.
        rF   z-Sparse precomputed kernels are not supported.rZ   ÚcsrF)ÚdtypeÚorderÚaccept_sparseÚaccept_large_sparseN©rv   ©r$   r%   Únu_scvÚNuSVCÚSVCr   zsThe `probability` parameter was deprecated in 1.9 and will be removed in version 1.11. Use `CalibratedClassifierCV(z!(), ensemble=False)` instead of `z(probability=True)`é   r   z"X and y have incompatible shapes.
zX has z samples, but y has ú.r*   zDPrecomputed matrix must be a square matrix. Input is a {}x{} matrix.z.sample_weight and X have incompatible shapes: z vs zT
Note: Sparse matrices cannot be indexed w/boolean masks (use `indices=True` in CV).rK   rI   rN   rJ   z[LibSVM]Ú ©ÚendÚi)Úrandom_seedr+   rR   zxThe dual coefficients or intercepts are not finite. The input data may contain large values and need to be preprocessed.)8r   rS   ÚspÚissparserU   Ú	TypeErrorÚcallableÚ_sparser!   r#   r,   Úfloat64Ú_validate_targetsÚasarrayre   Úindexrd   r^   Ú_effective_probabilityÚwarningsÚwarnÚFutureWarningr    r+   rf   ÚformatÚ_gammaÚ
isinstancerW   ÚstrÚmultiplyÚmeanÚvarr   Ú_sparse_fitÚ
_dense_fitrQ   ÚprintÚrandintÚiinfoÚmaxÚhasattrÚ
shape_fit_Ú
intercept_ÚcopyÚ_intercept_Ú
dual_coef_Ú_dual_coef_ÚlenÚclasses_ÚdataÚisfiniteÚallÚ	_num_iterÚn_iter_Úitem)rg   ÚXÚyÚsample_weightÚrndro   Úsolver_typeÚest_depÚ	n_samplesrU   ÚX_varÚfitÚseedr1   Úintercept_finitenessÚdual_coef_finitenesss                   r=   r·   zBaseLibSVM.fitª   s4  € õD ! Ô!2Ñ3Ô3ˆå”˜Q‘”ˆØð 	M�d”k ]Ò2Ð2ÝÐKÑLÔLÐLØÐ;¥h¨t¬{Ñ&;Ô&;Ð";ˆŒå�D”KÑ Ô ð 	Ý# A qÑ)Ô)Ð)Ð)å ØØØÝ”jØØ#Ø$)ðñ ô ‰DˆAˆqð ×"Ò" 1Ñ%Ô%ˆåœ
ØÐ'ˆBˆB¨]Å"Ä*ð
ñ 
ô 
ˆõ "×'Ò'¨¬
Ñ3Ô3ˆð '+Ô&6ˆÔ#ØŒ:Ð,Ð,Ð,ØŒz˜XÒ%Ð%Ø!��à�ØÔ <Ò/Ð/Ý”ð@à3:ð@ð @ð $+ð@ð @ð @õ "ñô ð ð ð /4�Ô+õ ! ‘O”Oˆ	Ø˜!ÒÐ 	¨Q¬W°Q¬ZÒ 7Ð 7ÝØ5Ð5Ø7@°y°yÀ!Ä'È!Ä*À*À*ÐMñNñô ð ð
 Œ;˜-Ò'Ð'¨I¸¼À¼Ò,CÐ,CÝð,ß,2ªF°1´7¸1´:¸q¼wÀq¼zÑ,JÔ,Jñô ð ð
 Ô˜qÔ! AÒ%Ð%¨-Ô*=¸aÔ*@ÀIÒ*MÐ*MÝ�*ð
 !Ô&Ð&Ð&¨¬¨¨ð	1ñô ð õ #+¨4¬;Ñ"7Ô"7ÐH��¸T¼[ˆà�]Ò"Ð"ð ˆDŒKˆKÝ˜œ
¥CÑ(Ô(ð 	%ØŒz˜WÒ$Ð$àDJÐW˜Ÿš A™œ×,Ò,Ñ.Ô.°!·&²&±(´(¸q±Ñ@Ð@ÐPQ×PUÒPUÑPWÔPW�Ø<AÀQºJ¸J˜c Q¤W¨Q¤Z°%Ñ%7Ñ8Ð8ÈC�”�Ø”˜vÒ%Ð%Ø! A¤G¨A¤JÑ.�”øÝ˜œ
¥DÑ)Ô)ð 	%Øœ*ˆDŒKà"&¤,ÐCˆdÔÐ°D´OˆØŒ<ð 	&Ý�* "Ð%Ñ%Ô%Ð%à�{Š{�2œ8 C™=œ=Ô,Ñ-Ô-ˆØˆˆAˆq�- ¨fÀ$ÐGÑGÔGÐGõ &-¨Q°Ñ%8Ô%8ÐJ˜!œ'˜'¸y¸lˆŒð
  œ?×/Ò/Ñ1Ô1ˆÔØœ?ˆÔØŒ:Ð,Ð,Ð,µ°T´]Ñ1CÔ1CÀqÒ1HÐ1HØˆOŒO˜rÑ!ˆOŒOØ#œÐ.ˆDŒOà-1¬\ÐO�DÔ$Ô)Ð)¸tÔ?Oˆ	Ý!œ{¨4Ô+;Ñ<Ô<×@Ò@ÑBÔBÐÝ!œ{¨9Ñ5Ô5×9Ò9Ñ;Ô;ÐØ$ð 	Ð)=ð 	Ýð!ñô ð ð Œ:Ð,Ð,Ð,Øœ>ˆDŒLˆLàœ>×.Ò.Ñ0Ô0ˆDŒLàˆr?   c                 ób   — t          |d¬¦  «                             t          j        d¬¦  «        S )zxValidation of y and class_weight.

        Default implementation for SVR and one-class; overridden in BaseSVC.
        T©r‘   F)r£   )r   Úastyper,   r‹   )rg   r°   s     r=   rŒ   zBaseLibSVM._validate_targetsJ  s,   € õ
 ˜A DÐ)Ñ)Ô)×0Ò0µ´À%Ð0ÑHÔHÐHr?   c                 óz   — | j         dv sJ ‚| j         dk    r$t          j        d| j        z  t          ¦  «         d S d S )N©r   r*   r*   znSolver terminated early (max_iter=%i).  Consider pre-processing your data with StandardScaler or MinMaxScaler.)Úfit_status_r�   r‘   ra   r
   ©rg   s    r=   Ú_warn_from_fit_statusz BaseLibSVM._warn_from_fit_statusQ  s_   € ØÔ 6Ð)Ð)Ð)Ð)ØÔ˜qÒ Ð ÝŒMð3à59´]ñCõ #ñ	ô ð ð ð ð !Ð r?   c                 ó¶  — t          | j        ¦  «        rG|| _        |                      |¦  «        }|j        d         |j        d         k    rt          d¦  «        ‚t          j        | j        ¦  «         t          j	        ||fi d|“d|“dt          | dt          j        d¦  «        ¦  «        “d|“d	| j        “d
| j        “d| j        “d| j        “d| j        “d| j        “d| j        “d| j        “d| j        “d| j        “d| j        “d|“Ž\	  | _        | _        | _        | _        | _        | _        | _        | _        | _         |  !                    ¦   «          d S )Nr   r*   z(X.shape[0] should be equal to X.shape[1]Úsvm_typer±   r`   Úclass_weight_rU   rZ   r[   r^   rV   r]   rY   r_   rX   rW   r\   ra   r…   )"r‰   rU   Ú_BaseLibSVM__XfitÚ_compute_kernelr+   rf   ÚlibsvmÚset_verbosity_wraprQ   r·   Úgetattrr,   ÚemptyrZ   r[   r�   rV   r]   rY   r_   rX   r”   r\   ra   Úsupport_Úsupport_vectors_Ú
_n_supportr¥   r¢   Ú_probAÚ_probBrÀ   r¬   rÂ   )rg   r¯   r°   r±   r³   rU   r…   s          r=   r›   zBaseLibSVM._dense_fit[  sÁ  € Ý�D”KÑ Ô ð 	Mð ˆDŒKØ×$Ò$ QÑ'Ô'ˆAàŒw�qŒz˜QœW QœZÒ'Ð'Ý Ð!KÑLÔLÐLåÔ! $¤,Ñ/Ô/Ð/õ ŒJØØð
ð 
ð 
ð !�[ð
ð (˜-ð	
õ
 !  ½¼À¹¼ÑDÔDÐDð
ð �6ð
ð Œfˆfð
ð Œwˆwð
ð Ô3Ð3ð
ð ”;�;ð
ð ”n�nð
ð ”�ð
ð ”�ð
ð ”*�*ð
ð ”+�+ð
ð  ”L�Lð!
ð" ”]�]ð#
ð$ $˜ð%
ñ
	
ØŒMØÔ!ØŒOØŒOØŒOØŒKØŒKØÔØŒNð, 	×"Ò"Ñ$Ô$Ð$Ð$Ð$r?   c                 óž  — t          j        |j        t           j        d¬¦  «        |_        |                     ¦   «          | j                             |¦  «        }t          j        | j	        ¦  «         t          j
        |j        d         |j        |j        |j        |||| j        | j        | j        | j        | j        t'          | dt          j        d¦  «        ¦  «        || j        | j        | j        t1          | j        ¦  «        t1          | j        ¦  «        | j        |¦  «        \	  | _        | _        }| _        | _        | _         | _!        | _"        | _#        |  $                    ¦   «          tK          | d¦  «        rtM          | j'        ¦  «        dz
  }	nd}	| j        j        d         }
t          j(        t          j)        |
¦  «        |	¦  «        }|
s)tU          tW          j,        g g¦  «        ¦  «        | _-        d S t          j)        d|j.        dz   |j.        |	z  ¦  «        }tU          tW          j,        |||f|	|
f¦  «        ¦  «        | _-        d S )NrZ   ©rv   rw   r*   rÅ   r   r¨   )/r,   r�   r©   r‹   Úsort_indicesÚ_sparse_kernelsrŽ   Úlibsvm_sparserÉ   rQ   Úlibsvm_sparse_trainr+   ÚindicesÚindptrrV   r”   rX   rY   rZ   rÊ   rË   r[   r_   r\   Úintr]   r�   ra   rÌ   rÍ   r¢   rÎ   rÏ   rÐ   rÀ   r¬   rÂ   r    r§   r¨   ÚtileÚaranger   r†   Ú	csr_arrayr¥   Úsize)rg   r¯   r°   r±   r³   rU   r…   Úkernel_typeÚdual_coef_datar4   Ún_SVÚdual_coef_indicesÚdual_coef_indptrs                r=   rš   zBaseLibSVM._sparse_fitŠ  s  € Ý”˜AœF­"¬*¸CÐ@Ñ@Ô@ˆŒØ	�ŠÑÔÐàÔ*×0Ò0°Ñ8Ô8ˆåÔ(¨¬Ñ6Ô6Ð6õ Ô-ØŒG�AŒJØŒFØŒIØŒHØØØØŒKØŒKØŒJØŒHØŒFÝ�D˜/­2¬8°A©;¬;Ñ7Ô7ØØŒGØŒOØŒLÝ�”ÑÔÝ�Ô+Ñ,Ô,ØŒMØñ+
ô 
ñ
	
ØŒMØÔ!ØØŒOØŒOØŒKØŒKØÔØŒNð2 	×"Ò"Ñ$Ô$Ð$å�4˜Ñ$Ô$ð 	Ý˜$œ-Ñ(Ô(¨1Ñ,ˆGˆGàˆGØÔ$Ô*¨1Ô-ˆåœG¥B¤I¨d¡O¤O°WÑ=Ô=ÐØð 	Ý2µ2´<ÀÀÑ3EÔ3EÑFÔFˆDŒOˆOˆOå!œyØÐ$Ô)¨AÑ-Ð/@Ô/EÈÑ/Oñ ô  Ðõ 3Ý”Ø#Ð%6Ð8HÐIØ˜d�Oñô ñô ˆDŒOˆOˆOr?   c                 ól   — |                       |¦  «        }| j        r| j        n| j        } ||¦  «        S )aÇ  Perform regression on samples in X.

        For a one-class model, +1 (inlier) or -1 (outlier) is returned.

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape (n_samples, n_features)
            For kernel="precomputed", the expected shape of X is
            (n_samples_test, n_samples_train).

        Returns
        -------
        y_pred : ndarray of shape (n_samples,)
            The predicted values.
        )Ú_validate_for_predictrŠ   Ú_sparse_predictÚ_dense_predict)rg   r¯   Úpredicts      r=   rç   zBaseLibSVM.predictÊ  s<   € ð  ×&Ò& qÑ)Ô)ˆØ*.¬,ÐO�$Ô&Ð&¸DÔ<OˆØˆw�q‰zŒzÐr?   c                 ó  — |                       |¦  «        }|j        dk    rt          |dd¬¦  «        }| j        }t	          | j        ¦  «        rHd}|j        d         | j        d         k    r*t          d|j        d         | j        d         fz  ¦  «        ‚t           	                    | j
        ¦  «        }t          j        || j        | j        | j        | j        | j        | j        | j        ||| j        | j        | j        | j        ¬¦  «        S )	Nr*   rZ   F)rw   ry   rF   r   úMX.shape[1] = %d should be equal to %d, the number of samples at training time)rÄ   rU   rV   rX   rW   r_   )rÇ   Úndimr   rU   r‰   r+   r¡   rf   re   rŽ   rd   rÈ   rç   rÌ   rÍ   rÎ   r¦   r¤   rÏ   rÐ   rV   rX   r”   r_   )rg   r¯   rU   rÄ   s       r=   ræ   zBaseLibSVM._dense_predictÞ  s  € Ø× Ò  Ñ#Ô#ˆØŒ6�QŠ;ˆ;Ý˜A S¸eÐDÑDÔDˆAà”ˆÝ�D”KÑ Ô ð 	Ø"ˆFØŒw�qŒz˜Tœ_¨QÔ/Ò/Ð/Ý ð=à”w˜q”z 4¤?°1Ô#5Ð6ñ7ñô ð õ ×$Ò$ T¤ZÑ0Ô0ˆåŒ~ØØŒMØÔ!ØŒOØÔØÔØŒKØŒKØØØ”;Ø”*Ø”+Ø”ð
ñ 
ô 
ð 	
r?   c                 ó   — | j         }t          |¦  «        rd}| j                             |¦  «        }d}t	          j        |j        |j        |j        | j	        j        | j	        j        | j	        j        | j
        j        | j        t                               | j        ¦  «        || j        | j        | j        | j        |t%          | dt'          j        d¦  «        ¦  «        | j        | j        | j        | j        | j        | j        | j        ¦  «        S )NrF   rK   rÅ   r   )rU   r‰   rÔ   rŽ   rÕ   Úlibsvm_sparse_predictr©   r×   rØ   rÍ   r¦   r¤   re   rd   rV   r”   rX   rY   rÊ   r,   rË   r[   r\   r]   r�   rÎ   rÏ   rÐ   )rg   r¯   rU   rÞ   rZ   s        r=   rå   zBaseLibSVM._sparse_predict   sï   € à”ˆÝ�FÑÔð 	#Ø"ˆFàÔ*×0Ò0°Ñ8Ô8ˆàˆåÔ2ØŒFØŒIØŒHØÔ!Ô&ØÔ!Ô)ØÔ!Ô(ØÔÔ!ØÔÝ×Ò˜dœjÑ)Ô)ØØŒKØŒKØŒJØŒHØÝ�D˜/­2¬8°A©;¬;Ñ7Ô7ØŒGØŒLØŒNØÔ'ØŒOØŒKØŒKñ/
ô 
ð 	
r?   c                 óö   — t          | j        ¦  «        rd|                      || j        ¦  «        }t          j        |¦  «        r|                     ¦   «         }t          j        |t          j        d¬¦  «        }|S )z0Return the data transformed by a callable kernelrZ   rÒ   )	r‰   rU   rÆ   r†   r‡   Útoarrayr,   r�   r‹   ©rg   r¯   rU   s      r=   rÇ   zBaseLibSVM._compute_kernel$  sj   € å�D”KÑ Ô ð 	@ð —[’[  D¤KÑ0Ô0ˆFÝŒ{˜6Ñ"Ô"ð *ØŸšÑ)Ô)�Ý”
˜6­¬¸3Ð?Ñ?Ô?ˆAØˆr?   c                 ó*  — |                       |¦  «        }|                      |¦  «        }| j        r|                      |¦  «        }n|                      |¦  «        }| j        dv r-t          | j        ¦  «        dk    r|                     ¦   «          S |S )af  Evaluates the decision function for the samples in X.

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

        Returns
        -------
        X : array-like of shape (n_samples, n_class * (n_class-1) / 2)
            Returns the decision function of the sample for each class
            in the model.
        r{   r   )	rä   rÇ   rŠ   Ú_sparse_decision_functionÚ_dense_decision_functionrd   r§   r¨   Úravel)rg   r¯   Údec_funcs      r=   Ú_decision_functionzBaseLibSVM._decision_function/  s˜   € ð ×&Ò& qÑ)Ô)ˆØ× Ò  Ñ#Ô#ˆàŒ<ð 	8Ø×5Ò5°aÑ8Ô8ˆHˆHà×4Ò4°QÑ7Ô7ˆHð Œ:Ð,Ð,Ð,µ°T´]Ñ1CÔ1CÀqÒ1HÐ1HØ—N’NÑ$Ô$Ð$Ð$àˆr?   c                 óX  — t          |t          j        dd¬¦  «        }| j        }t	          |¦  «        rd}t          j        || j        | j        | j	        | j
        | j        | j        | j        t                               | j        ¦  «        || j        | j        | j        | j        ¬¦  «        S )NrZ   F)rv   rw   ry   rF   ©rÄ   rU   rV   r_   rX   rW   )r   r,   r‹   rU   r‰   rÈ   Údecision_functionrÌ   rÍ   rÎ   r¦   r¤   rÏ   rÐ   re   rŽ   rd   rV   r_   rX   r”   rï   s      r=   rò   z#BaseLibSVM._dense_decision_functionM  s£   € Ý˜¥¤°3ÈEÐRÑRÔRˆà”ˆÝ�FÑÔð 	#Ø"ˆFåÔ'ØØŒMØÔ!ØŒOØÔØÔØŒKØŒKÝ ×&Ò& t¤zÑ2Ô2ØØ”;Ø”Ø”*Ø”+ð
ñ 
ô 
ð 	
r?   c                 ó~  — t          j        |j        t           j        d¬¦  «        |_        | j        }t          |d¦  «        rd}| j                             |¦  «        }t          j	        |j        |j
        |j        | j        j        | j        j
        | j        j        | j        j        | j        t                               | j        ¦  «        || j        | j        | j        | j        | j        t-          | dt          j        d¦  «        ¦  «        | j        | j        | j        | j        | j        | j        | j        ¦  «        S )NrZ   rÒ   Ú__call__rF   rÅ   r   )r,   r�   r©   r‹   rU   r    rÔ   rŽ   rÕ   Úlibsvm_sparse_decision_functionr×   rØ   rÍ   r¦   r¤   re   rd   rV   r”   rX   rY   rZ   rÊ   rË   r[   r\   r]   r�   rÎ   rÏ   rÐ   ©rg   r¯   rU   rÞ   s       r=   rñ   z$BaseLibSVM._sparse_decision_functione  s
  € Ý”˜AœF­"¬*¸CÐ@Ñ@Ô@ˆŒà”ˆÝ�6˜:Ñ&Ô&ð 	#Ø"ˆFàÔ*×0Ò0°Ñ8Ô8ˆåÔ<ØŒFØŒIØŒHØÔ!Ô&ØÔ!Ô)ØÔ!Ô(ØÔÔ!ØÔÝ×Ò˜dœjÑ)Ô)ØØŒKØŒKØŒJØŒHØŒFÝ�D˜/­2¬8°A©;¬;Ñ7Ô7ØŒGØŒLØŒNØÔ'ØŒOØŒKØŒKñ/
ô 
ð 	
r?   c           	      ó0  — t          | ¦  «         t          | j        ¦  «        s t          | |dt          j        ddd¬¦  «        }| j        rIt          j        |¦  «        s!t          t          j
        |¦  «        ¦  «        }|                     ¦   «          t          j        |¦  «        r?| j        s8t          | j        ¦  «        s$t          dt          | ¦  «        j        z  ¦  «        ‚| j        dk    rF|j        d         | j        d         k    r*t          d	|j        d         | j        d         fz  ¦  «        ‚| j        }| j        sP|j        dk    rE| j                             ¦   «         |j        d         k    rt          d
| j        j        › d�¦  «        ‚|S )Nru   rZ   F)rx   rv   rw   ry   Úresetz3cannot use sparse input in %r trained on dense datarF   r*   r   ré   zThe internal representation of z was altered)r"   r‰   rU   r#   r,   r‹   rŠ   r†   r‡   r   rÜ   rÓ   rf   ÚtypeÚ__name__r+   r¡   rÍ   rÝ   Ú
n_support_Úsumrr   )rg   r¯   Úsvs      r=   rä   z BaseLibSVM._validate_for_predictˆ  sŸ  € Ý˜ÑÔÐå˜œÑ$Ô$ð 		ÝØØØ#Ý”jØØ$)Øðñ ô ˆAð Œ<ð 	Ý”;˜q‘>”>ð :Ý(­¬°a©¬Ñ9Ô9�Ø�NŠNÑÔÐåŒ;�q‰>Œ>ð 	 $¤,ð 	µxÀÄÑ7LÔ7Lð 	ÝØEÝ�t‘*”*Ô%ñ&ñô ð ð
 Œ;˜-Ò'Ð'ØŒw�qŒz˜Tœ_¨QÔ/Ò/Ð/Ý ð=à”w˜q”z 4¤?°1Ô#5Ð6ñ7ñô ð ð Ô"ˆØŒ|ð 	 ¤¨!¢ °´×0CÒ0CÑ0EÔ0EÈÌÐRSÌÒ0TÐ0TÝØW°$´.Ô2IÐWÐWÐWñô ð ð ˆr?   c                 óÆ   — | j         dk    rt          d¦  «        ‚|                      ¦   «         }t          j        |¦  «        rd|j        j        _        nd|j        _        |S )z“Weights assigned to the features when `kernel="linear"`.

        Returns
        -------
        ndarray of shape (n_features, n_classes)
        rD   z2coef_ is only available when using a linear kernelF)rU   ÚAttributeErrorÚ	_get_coefr†   r‡   r©   ÚflagsÚ	writeable©rg   r5   s     r=   Úcoef_zBaseLibSVM.coef_±  sc   € ð Œ;˜(Ò"Ð"Ý Ð!UÑVÔVÐVà�~Š~ÑÔˆõ Œ;�tÑÔð 	)à(-ˆDŒIŒOÔ%Ð%ð $)ˆDŒJÔ Øˆr?   c                 ó6   — t          | j        | j        ¦  «        S ©N)r   r¦   rÍ   rÁ   s    r=   r  zBaseLibSVM._get_coefÈ  s   € Ý˜tÔ/°Ô1FÑGÔGÐGr?   c                 óâ   — 	 t          | ¦  «         n# t          $ r t          ‚w xY wt                               | j        ¦  «        }|dv r| j        S t          j        | j        d         g¦  «        S )z)Number of support vectors for each class.r¿   r   )	r"   r   r  re   rŽ   rd   rÎ   r,   Úarray)rg   rÄ   s     r=   r  zBaseLibSVM.n_support_Ë  s   € ð	!Ý˜DÑ!Ô!Ð!Ð!øÝð 	!ð 	!ð 	!Ý Ð ð	!øøøõ ×$Ò$ T¤ZÑ0Ô0ˆØ�vÐÐØ”?Ð"õ ”8˜Tœ_¨QÔ/Ð0Ñ1Ô1Ð1s   ‚ ’$r  )$r   Ú
__module__Ú__qualname__Ú__doc__r   r‰   r   r   r   r   Údictrb   Ú__annotations__rÔ   r   rh   rl   r	   r·   rŒ   rÂ   r›   rš   rç   ræ   rå   rÇ   rõ   rò   rñ   rä   Úpropertyr
  r  r  Ú__classcell__©rr   s   @r=   rA   rA   V   s  ø€ € € € € € ðð ð ˆJÐJÐJÐJÑKÔKØð
ð �8˜H a¨°fÐ=Ñ=Ô=Ð>àˆJ˜ Ð(Ñ)Ô)ØˆH�T˜3 ¨VÐ4Ñ4Ô4ð
ð �(˜4  t°IÐ>Ñ>Ô>Ð?Ø�˜˜s D°Ð;Ñ;Ô;Ð<Øˆh�t˜S $¨wÐ7Ñ7Ô7Ð8Øˆx˜˜c 3¨wÐ7Ñ7Ô7Ð8Ø�H˜T 3¨°VÐ<Ñ<Ô<Ð=Ø�[Ø! 6 6¨*¨*°l°^Ñ*DÔ*DÑ#EÔ#EÐFØ�x  a¨°iÐ@Ñ@Ô@ÐAØ#˜ Z LÑ1Ô1°4¸Ð>Ø�;Ø�X˜h¨¨D¸Ð@Ñ@Ô@ÐAØ'Ð(ð+$ð $Ð˜Dð ð ñ ð6 JÐIÐI€Oàð%)ð %)ñ „^ð%)ðNð ð ð ð ð €\°Ð5Ñ5Ô5ð]ð ]ð ]ñ 6Ô5ð]ð~Ið Ið Iðð ð ð-%ð -%ð -%ð^>ð >ð >ð@ð ð ð( 
ð  
ð  
ðD"
ð "
ð "
ðH	ð 	ð 	ðð ð ð<
ð 
ð 
ð0!
ð !
ð !
ðF'ð 'ð 'ðR ðð ñ „Xðð,Hð Hð Hð ð2ð 2ñ „Xð2ð 2ð 2ð 2ð 2r?   rA   )Ú	metaclassc                   ó   ‡ — e Zd ZU dZi ej        ¥ eddh¦  «        gdgdœ¥Zeed<   dD ]Z	e 
                    e	¦  «         Œeˆ fd„¦   «         Zd	„ Zd
„ Zˆ fd„Zd„ Z ee¦  «        d„ ¦   «         Z ee¦  «        d„ ¦   «         Zd„ Zd„ Zd„ Z ed¦  «        ed„ ¦   «         ¦   «         Z ed¦  «        ed„ ¦   «         ¦   «         Zˆ fd„Zˆ xZS )ÚBaseSVCz!ABC for LibSVM-based classifiers.ÚovrÚovorO   )Údecision_function_shapeÚ
break_tiesrb   )r\   r[   c                 ó„   •— || _         || _        t          ¦   «                              |||||||d||	|
||||¬¦  «         d S )NrK   rT   )r  r  rk   rh   )rg   rU   rV   rW   rX   rY   rZ   r[   r]   r^   r_   r`   rQ   ra   r  rS   r  rr   s                    €r=   rh   zBaseSVC.__init__ç  sl   ø€ ð( (?ˆÔ$Ø$ˆŒÝ‰Œ×ÒØØØØØØØØØØ#Ø!Ø%ØØØ%ð 	ñ 	
ô 	
ð 	
ð 	
ð 	
r?   c                 ó`  — t          |d¬¦  «        }t          |¦  «         t          j        |d¬¦  «        \  }}t	          | j        ||¬¦  «        | _        t          |¦  «        dk     rt          dt          |¦  «        z  ¦  «        ‚|| _	        t          j
        |t          j        d¬¦  «        S )	NTr¼   )Úreturn_inverse)Úclassesr°   r   z>The number of classes has to be greater than one; got %d classrZ   rÒ   )r   r   r,   Úuniquer   r`   rÅ   r§   rf   r¨   r�   r‹   )rg   r°   Úy_Úclss       r=   rŒ   zBaseSVC._validate_targets  s©   € Ý˜! $Ð'Ñ'Ô'ˆÝ$ QÑ'Ô'Ð'Ý”˜2¨dÐ3Ñ3Ô3‰ˆˆQÝ1°$Ô2CÈSÐTVÐWÑWÔWˆÔÝˆs‰8Œ8�aŠ<ˆ<ÝØPÝ�c‘(”(ññô ð ð
 ˆŒåŒz˜!¥2¤:°SÐ9Ñ9Ô9Ð9r?   c                 óÆ   — |                       |¦  «        }| j        dk    r@t          | j        ¦  «        dk    r(t	          |dk     | t          | j        ¦  «        ¦  «        S |S )a4  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).

        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
        <https://stats.stackexchange.com/questions/14876/
        interpreting-distance-from-hyperplane-in-svm>`_ for further details.
        If decision_function_shape='ovr', the decision function is a monotonic
        transformation of ovo decision function.
        r  r   r   )rõ   r  r§   r¨   r   )rg   r¯   Údecs      r=   rø   zBaseSVC.decision_function  s`   € ð6 ×%Ò% aÑ(Ô(ˆØÔ'¨5Ò0Ð0µS¸¼Ñ5GÔ5GÈ!Ò5KÐ5KÝ)¨#°ª'°C°4½¸T¼]Ñ9KÔ9KÑLÔLÐLØˆ
r?   c                 ó¾  •— t          | ¦  «         | j        r| j        dk    rt          d¦  «        ‚| j        rM| j        dk    rBt	          | j        ¦  «        dk    r*t          j        |                      |¦  «        d¬¦  «        }n!t          ¦   «          
                    |¦  «        }| j                             t          j        |t          j        ¬¦  «        ¦  «        S )aö  Perform classification on samples in X.

        For a one-class model, +1 or -1 is returned.

        Parameters
        ----------
        X : {array-like, sparse matrix} of shape (n_samples, n_features) or                 (n_samples_test, n_samples_train)
            For kernel="precomputed", the expected shape of X is
            (n_samples_test, n_samples_train).

        Returns
        -------
        y_pred : ndarray of shape (n_samples,)
            Class labels for samples in X.
        r  z>break_ties must be False when decision_function_shape is 'ovo'r  r   r*   )Úaxisrz   )r"   r  r  rf   r§   r¨   r,   Úargmaxrø   rk   rç   Útaker�   Úintp)rg   r¯   r°   rr   s      €r=   rç   zBaseSVC.predict>  sÎ   ø€ õ" 	˜ÑÔÐØŒ?ð 	˜tÔ;¸uÒDÐDÝØPñô ð ð
 ŒOð	#àÔ,°Ò5Ð5Ý�D”MÑ"Ô" QÒ&Ð&å”	˜$×0Ò0°Ñ3Ô3¸!Ð<Ñ<Ô<ˆAˆAå‘”—’ Ñ"Ô"ˆAØŒ}×!Ò!¥"¤*¨Qµb´gÐ">Ñ">Ô">Ñ?Ô?Ð?r?   c                 óx   — | j         dk    s| j         st          d¦  «        ‚| j        dvrt          d¦  «        ‚dS )Nr   z5predict_proba is not available when probability=Falser{   z0predict_proba only implemented for SVC and NuSVCT)r^   r  rd   rÁ   s    r=   Ú_check_probazBaseSVC._check_probac  sQ   € ØÔ˜|Ò+Ð+°4Ô3CÐ+Ý ØGñô ð ð Œ:Ð0Ð0Ð0Ý Ð!SÑTÔTÐTØˆtr?   c                 óÊ   — |                       |¦  «        }| j        j        dk    s| j        j        dk    rt	          d¦  «        ‚| j        r| j        n| j        } ||¦  «        S )aÄ  Compute probabilities of possible outcomes for samples in X.

        The model needs to have probability information computed at training
        time: fit with attribute `probability` set to True.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            For kernel="precomputed", the expected shape of X is
            (n_samples_test, n_samples_train).

        Returns
        -------
        T : ndarray of shape (n_samples, n_classes)
            Returns the probability of the sample for each class in
            the model. The columns correspond to the classes in sorted
            order, as they appear in the attribute :term:`classes_`.

        Notes
        -----
        The probability model is created using cross validation, so
        the results can be slightly different than those obtained by
        predict. Also, it will produce meaningless results on very small
        datasets.
        r   zApredict_proba is not available when fitted with probability=False)rä   rÏ   rÝ   rÐ   r   rŠ   Ú_sparse_predict_probaÚ_dense_predict_proba)rg   r¯   Ú
pred_probas      r=   Úpredict_probazBaseSVC.predict_probal  sw   € ð6 ×&Ò& qÑ)Ô)ˆØŒ;Ô˜qÒ Ð  D¤KÔ$4¸Ò$9Ð$9Ý ØSñô ð ð +/¬,ÐUˆDÔ&Ð&¸DÔ<Uð 	ð ˆz˜!‰}Œ}Ðr?   c                 óP   — t          j        |                      |¦  «        ¦  «        S )a  Compute log probabilities of possible outcomes for samples in X.

        The model need to have probability information computed at training
        time: fit with attribute `probability` set to True.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features) or                 (n_samples_test, n_samples_train)
            For kernel="precomputed", the expected shape of X is
            (n_samples_test, n_samples_train).

        Returns
        -------
        T : ndarray of shape (n_samples, n_classes)
            Returns the log-probabilities of the sample for each class in
            the model. The columns correspond to the classes in sorted
            order, as they appear in the attribute :term:`classes_`.

        Notes
        -----
        The probability model is created using cross validation, so
        the results can be slightly different than those obtained by
        predict. Also, it will produce meaningless results on very small
        datasets.
        )r,   Úlogr2  )rg   r¯   s     r=   Úpredict_log_probazBaseSVC.predict_log_proba‘  s"   € õ8 Œv�d×(Ò(¨Ñ+Ô+Ñ,Ô,Ð,r?   c                 óP  — |                       |¦  «        }| j        }t          |¦  «        rd}t                               | j        ¦  «        }t          j        || j        | j	        | j
        | j        | j        | j        | j        ||| j        | j        | j        | j        ¬¦  «        }|S )NrF   r÷   )rÇ   rU   r‰   re   rŽ   rd   rÈ   r2  rÌ   rÍ   rÎ   r¦   r¤   rÏ   rÐ   rV   r_   rX   r”   )rg   r¯   rU   rÄ   Úpprobs        r=   r0  zBaseSVC._dense_predict_proba¯  s§   € Ø× Ò  Ñ#Ô#ˆà”ˆÝ�FÑÔð 	#Ø"ˆFå×$Ò$ T¤ZÑ0Ô0ˆÝÔ$ØØŒMØÔ!ØŒOØÔØÔØŒKØŒKØØØ”;Ø”Ø”*Ø”+ð
ñ 
ô 
ˆð" ˆr?   c                 ó|  — t          j        |j        t           j        d¬¦  «        |_        | j        }t          |¦  «        rd}| j                             |¦  «        }t          j	        |j        |j
        |j        | j        j        | j        j
        | j        j        | j        j        | j        t                               | j        ¦  «        || j        | j        | j        | j        | j        t-          | dt          j        d¦  «        ¦  «        | j        | j        | j        | j        | j        | j        | j        ¦  «        S )NrZ   rÒ   rF   rÅ   r   )r,   r�   r©   r‹   rU   r‰   rÔ   rŽ   rÕ   Úlibsvm_sparse_predict_probar×   rØ   rÍ   r¦   r¤   re   rd   rV   r”   rX   rY   rZ   rÊ   rË   r[   r\   r]   r�   rÎ   rÏ   rÐ   rü   s       r=   r/  zBaseSVC._sparse_predict_probaÊ  s  € Ý”˜AœF­"¬*¸CÐ@Ñ@Ô@ˆŒà”ˆÝ�FÑÔð 	#Ø"ˆFàÔ*×0Ò0°Ñ8Ô8ˆåÔ8ØŒFØŒIØŒHØÔ!Ô&ØÔ!Ô)ØÔ!Ô(ØÔÔ!ØÔÝ×Ò˜dœjÑ)Ô)ØØŒKØŒKØŒJØŒHØŒFÝ�D˜/­2¬8°A©;¬;Ñ7Ô7ØŒGØŒLØŒNØÔ'ØŒOØŒKØŒKñ/
ô 
ð 	
r?   c                 óR  — | j         j        d         dk    rt          | j         | j        ¦  «        }nut	          | j         | j        | j        ¦  «        }t          j        |d         ¦  «        r't          j        |¦  «         	                    ¦   «         }nt          j        |¦  «        }|S )Nr   r*   )r¥   r+   r   rÍ   r>   rÎ   r†   r‡   ÚvstackÚtocsrr,   r	  s     r=   r  zBaseSVC._get_coefí  s‘   € ØŒ?Ô  Ô# qÒ(Ð(å" 4¤?°DÔ4IÑJÔJˆDˆDõ $Ø” ¤°$Ô2Gñô ˆDõ Œ{˜4 œ7Ñ#Ô#ð 'Ý”y ‘”×,Ò,Ñ.Ô.��å”y ‘”�àˆr?   z«Attribute `probA_` was deprecated in version 1.9 and will be removed in 1.11 as the `probability=True` option for SVC and NuSVC was deprecated and will be removed in 1.11.c                 ó   — | j         S ©z¡Parameter learned in Platt scaling when `probability=True`.

        Returns
        -------
        ndarray of shape  (n_classes * (n_classes - 1) / 2)
        )rÏ   rÁ   s    r=   ÚprobA_zBaseSVC.probA_ý  ó   € ð Œ{Ðr?   z«Attribute `probB_` was deprecated in version 1.9 and will be removed in 1.11 as the `probability=True` option for SVC and NuSVC was deprecated and will be removed in 1.11.c                 ó   — | j         S r>  )rÐ   rÁ   s    r=   ÚprobB_zBaseSVC.probB_  r@  r?   c                 ór   •— t          ¦   «                              ¦   «         }| j        dk    |j        _        |S rj   )rk   rl   rU   rm   ro   rp   s     €r=   rl   zBaseSVC.__sklearn_tags__  s.   ø€ Ý‰wŒw×'Ò'Ñ)Ô)ˆØ!%¤°Ò!=ˆŒÔØˆr?   )r   r  r  r  rA   rb   r   r  r  Úunused_paramÚpopr   rh   rŒ   rø   rç   r-  r   r2  r5  r0  r/  r  r   r  r?  rB  rl   r  r  s   @r=   r  r  Ü  s  ø€ € € € € € Ø+Ð+ð$Ø
Ô
+ð$à$. J°°u¨~Ñ$>Ô$>Ð#?Ø �kð$ð $ð $Ð˜Dð ð ñ ð
 *ð 1ð 1ˆØ×"Ò" <Ñ0Ô0Ð0Ð0àð%
ð %
ð %
ð %
ñ „^ð%
ðN:ð :ð :ðð ð ð@@ð @ð @ð @ð @ðJð ð ð €\�,ÑÔð"ð "ñ  Ôð"ðH €\�,ÑÔð-ð -ñ  Ôð-ð:ð ð ð6!
ð !
ð !
ðFð ð ð  €Zð	'ñô ð
 ðð ñ „Xñô ðð €Zð	'ñô ð
 ðð ñ „Xñô ððð ð ð ð ð ð ð ð r?   r  c           
      óœ  — ddidddœdœddd	iidd
idddœdœdddiiddddœiddœ}| dk    r||          S | dk    rt          d| z  ¦  «        ‚|                     |d¦  «        }|€d|z  }nH|                     |d¦  «        }|€
d|›d|›d�}n&|                     |d¦  «        }|€d|›d|›d|›�}n|S t          d|›d|›d|›d|›�¦  «        ‚)a  Find the liblinear magic number for the solver.

    This number depends on the values of the following attributes:
      - multi_class
      - penalty
      - loss
      - dual

    The same number is also internally used by LibLinear to determine
    which solver to use.
    Fé   r   é   )FT)Úl1Úl2rJ  Té   é   r   r*   é   é   é   é   )Úlogistic_regressionÚhingeÚsquared_hingeÚepsilon_insensitiveÚsquared_epsilon_insensitiveÚcrammer_singerrV  r  z<`multi_class` must be one of `ovr`, `crammer_singer`, got %rNzloss='%s' is not supportedzThe combination of penalty='z' and loss='z' is not supportedz' are not supported when dual=zUnsupported set of arguments: z, Parameters: penalty=z, loss=z, dual=)rf   Úget)	Úmulti_classÚpenaltyÚlossÚdualÚ_solver_type_dictÚ_solver_penÚerror_stringÚ_solver_dualÚ
solver_nums	            r=   Ú_get_liblinear_solver_typera  !  s„  € ð" (-¨a jÀÈÐ8KÐ8KÐLÐLØ˜˜q˜	Ð"Ø!&¨ 
¸!À1Ð2EÐ2EÐFÐFØ $ t¨R jÐ1Ø(,°bÀÐ.CÐ.CÐ'DØðð Ðð Ð&Ò&Ð&Ø  Ô-Ð-Ø	˜Ò	Ð	ÝØJÈ[ÑXñ
ô 
ð 	
ð $×'Ò'¨¨dÑ3Ô3€KØÐØ3°dÑ:ˆˆà"—’ w°Ñ5Ô5ˆØÐÐð �7�7˜D˜D˜Dð"ð ˆLð
 &×)Ò)¨$°Ñ5Ô5ˆJØÐ!Ð!ð CJÀ'À'È4È4È4ÐQUÐQUðWð �ð
 "Ð!Ý
ˆ*àˆ<ˆ<˜˜˜ $ $ $¨¨ð	.ñô ð r?   r  rQ  çš™™™™™¹?c                 óÞ  — |dvrit          ¦   «         }|                     |¦  «        }|j        }t          |¦  «        dk     rt	          d|d         z  ¦  «        ‚t          ||||¬¦  «        }n"t          j        dt          j        ¬¦  «        }|}t          j
        |¦  «         t          |¦  «        }|rt          dd¬	¦  «         d
}|r|dk    rt	          d|z  ¦  «        ‚|}t          j
        |¦  «         t          j
        |¦  «         t          j
        |¦  «         t          j        | ¦  «        rt#          | ¦  «         t          j        |t          j        ¬¦  «                             ¦   «         }t          j        |d¬¦  «        }t+          || t          j        ¬¦  «        }t-          ||||¦  «        }t          j        | |t          j        | ¦  «        ||
||||	|                     t          j        d¦  «        j        ¦  «        ||¦  «        \  }}t5          |¦  «        }||	k    rt7          j        dt:          ¦  «         |r|dd…dd…f         }||dd…df         z  }n|}d}|||fS )a  Used by Logistic Regression (and CV) and LinearSVC/LinearSVR.

    Preprocessing is done in this function before supplying it to liblinear.

    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

    C : float
        Inverse of cross-validation parameter. The lower the C, the higher
        the penalization.

    fit_intercept : bool
        Whether or not to fit an intercept. If set to True, the feature vector
        is extended to include an intercept term: ``[x_1, ..., x_n, 1]``, where
        1 corresponds to the intercept. If set to False, no intercept will be
        used in calculations (i.e. data is expected to be already centered).

    intercept_scaling : float
        Liblinear internally penalizes the intercept, treating it like any
        other term in the feature vector. To reduce the impact of the
        regularization on the intercept, the `intercept_scaling` parameter can
        be set to a value greater than 1; the higher the value of
        `intercept_scaling`, the lower the impact of regularization on it.
        Then, the weights become `[w_x_1, ..., w_x_n,
        w_intercept*intercept_scaling]`, where `w_x_1, ..., w_x_n` represent
        the feature weights and the intercept weight is scaled by
        `intercept_scaling`. This scaling allows the intercept term to have a
        different regularization behavior compared to the other features.

    class_weight : dict or 'balanced', default=None
        Weights associated with classes in the form ``{class_label: weight}``.
        If not given, all classes are supposed to have weight one. For
        multi-output problems, a list of dicts can be provided in the same
        order as the columns of y.

        The "balanced" mode uses the values of y to automatically adjust
        weights inversely proportional to class frequencies in the input data
        as ``n_samples / (n_classes * np.bincount(y))``

    penalty : {'l1', 'l2'}
        The norm of the penalty used in regularization.

    dual : bool
        Dual or primal formulation,

    verbose : int
        Set verbose to any positive number for verbosity.

    max_iter : int
        Number of iterations.

    tol : float
        Stopping condition.

    random_state : int, RandomState instance or None, default=None
        Controls the pseudo random number generation for shuffling the data.
        Pass an int for reproducible output across multiple function calls.
        See :term:`Glossary <random_state>`.

    multi_class : {'ovr', 'crammer_singer'}, default='ovr'
        `ovr` trains n_classes one-vs-rest classifiers, while `crammer_singer`
        optimizes a joint objective over all classes.
        While `crammer_singer` is interesting from a theoretical perspective
        as it is consistent it is seldom used in practice and rarely leads to
        better accuracy and is more expensive to compute.
        If `crammer_singer` is chosen, the options loss, penalty and dual will
        be ignored.

    loss : {'logistic_regression', 'hinge', 'squared_hinge',             'epsilon_insensitive', 'squared_epsilon_insensitive},             default='logistic_regression'
        The loss function used to fit the model.

    epsilon : float, default=0.1
        Epsilon parameter in the epsilon-insensitive loss function. Note
        that the value of this parameter depends on the scale of the target
        variable y. If unsure, set epsilon=0.

    sample_weight : array-like of shape (n_samples,), default=None
        Weights assigned to each sample.

    Returns
    -------
    coef_ : ndarray of shape (n_features, n_features + 1)
        The coefficient vector got by minimizing the objective function.

    intercept_ : float
        The intercept term added to the vector.

    n_iter_ : array of int
        Number of iterations run across for each class.
    )rT  rU  r   zeThis solver needs samples of at least 2 classes in the data, but the data contains only one class: %rr   )r!  r°   r±   rz   z[LibLinear]r�   r‚   g      ð¿zqIntercept scaling is %r but needs to be greater than 0. To disable fitting an intercept, set fit_intercept=False.ÚW)Úrequirementsr„   z@Liblinear failed to converge, increase the number of iterations.NrR   rK   )r   Úfit_transformr¨   r§   rf   r   r,   rË   r‹   Ú	liblinearrÉ   r   rœ   rÈ   rÕ   r†   r‡   r   r�   ró   Úrequirer   ra  Ú
train_wrapr�   rž   rŸ   r�   r‘   r
   )r¯   r°   rZ   Úfit_interceptÚintercept_scalingr`   rY  r[  rQ   ra   rY   rS   rX  rZ  r\   r±   ÚencÚy_indr¨   rÅ   r²   Úbiasr³   Ú	raw_coef_r­   Ú
n_iter_maxr
  r¢   s                               r=   Ú_fit_liblinearrq  Z  s°  € ðh ÐIÐIÐIÝ‰nŒnˆØ×!Ò! !Ñ$Ô$ˆØ”<ˆÝˆx‰=Œ=˜1ÒÐÝðà'¨œ{ñ+ñô ð õ
 -Ø (¨a¸}ð
ñ 
ô 
ˆˆõ œ ­"¬*Ð5Ñ5Ô5ˆØˆÝÔ  Ñ)Ô)Ð)Ý
˜\Ñ
*Ô
*€CØð %Ýˆm Ð$Ñ$Ô$Ð$ð €DØð %Ø Ò!Ð!Ýð,à.?ñ@ñô ð ð %ˆDå
Ô˜gÑ&Ô&Ð&ÝÔ$ WÑ-Ô-Ð-ÝÔ  Ñ)Ô)Ð)õ 
„{�1�~„~ð Ý˜AÑÔÐõ ŒJ�u¥B¤JÐ/Ñ/Ô/×5Ò5Ñ7Ô7€EÝŒJ�u¨3Ð/Ñ/Ô/€Eå(¨¸ÅÄÐLÑLÔL€Må,¨[¸'À4ÈÑNÔN€KÝ"Ô-Ø	ØÝ
Œ�A‰ŒØØØØ	ØØØ�Š•B”H˜S‘M”MÔ%Ñ&Ô&ØØñô Ñ€Iˆwõ$ �W‘”€JØ�XÒÐÝŒØNÝñ	
ô 	
ð 	
ð
 ð Ø˜!˜!˜!˜S˜b˜S˜&Ô!ˆØ&¨°1°1°1°b°5Ô)9Ñ9ˆ
ˆ
àˆØˆ
à�*˜gÐ%Ð%r?   )Nr  rQ  rb  N)>r�   Úabcr   r   Únumbersr   r   Únumpyr,   Úscipy.sparsero   r†   Úsklearn.baser   r   r	   Úsklearn.exceptionsr
   r   Úsklearn.preprocessingr   Úsklearn.svmr   rg  r   rÈ   r   rÕ   Úsklearn.utilsr   r   r   r   r   Úsklearn.utils._param_validationr   r   r   Úsklearn.utils._sparser   Úsklearn.utils.extmathr   Úsklearn.utils.fixesr   Úsklearn.utils.metaestimatorsr   Úsklearn.utils.multiclassr   r   Úsklearn.utils.validationr   r   r    r!   r"   r#   re   r>   rA   r  ra  rq  © r?   r=   ú<module>rƒ     sà  ðð €€€Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø Ð Ð Ð Ð Ð à EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AØ .Ð .Ð .Ð .Ð .Ð .Ø /Ð /Ð /Ð /Ð /Ð /ð *Ð )Ð )Ð )Ð )Ð )Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7ðð ð ð ð ð ð ð ð ð ð ð ð ð ð IÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5ðð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð HÐGÐG€ð#ð #ð #ðLC
2ð C
2ð C
2ð C
2ð C
2�¨'ð C
2ñ C
2ô C
2ð C
2ðLBð Bð Bð Bð Bˆo˜z°Wð Bñ Bô Bð BðJ
6ð 6ð 6ðJ ØØ	ØØð!D&ð D&ð D&ð D&ð D&ð D&r?   