
    lriV              
          d dl Zd dlZd dlmZ d dlmZ d dlmZm	Z	m
Z
 d dlmZmZ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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( d dl)m*Z*m+Z+m,Z,m-Z- d dl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4 d dl5m6Z6 d dl7m8Z8m9Z9 d dl:m;Z;m<Z< d dl=m>Z> d dl?m@Z@ d dlAmBZBmCZCmDZDmEZEmFZF d dlGmHZH d dlImJZJ d dlKmLZLmMZMmNZNmOZOmPZP d dlQmRZR d dlSmTZT d dlUmVZV dZW ejX        d          d              ZYd! ZZej[        \                    d"eT          ej[        \                    d#d$d%g          ej[        \                    d&d'd(g          d)                                     Z]d* Z^ej[        \                    d&d'd(g          d+             Z_d, Z`ej[        \                    d#g d-          ej[        \                    d&d'd(g          d.                         Zaej[        jb        ej[        \                    d#g d-          ej[        \                    d&d'd(g          d/                                     Zcej[        \                    d#d$d%g          ej[        \                    d&d'd(g          ej[        \                    d0 edd1                    d2                                     Zed3 Zfej[        \                    d"eT          ej[        \                    d#g d-          d4                         Zgej[        \                    d#d5gd$ e            fd% e%d67          fd8 e            fg          d9             Zhd: Ziej[        \                    d;g d<          ej[        \                    d&d'd(g          d=                         Zjd> Zkd? Zlej[        \                    d#g d-          ej[        \                    d&d'd(g          d@                         Zmej[        \                    d#g d-          ej[        \                    d&d'd(g          dA                         Znej[        \                    d&d'd(g          dB             Zoej[        \                    dCejp        q                    dD          r                    dEdFd1          ejp        q                    dD          r                    dEdFd1dG          g          dH             ZsejX        dI             ZtejX        dJ             ZudK ZvdL ZwdM ZxdN Zy ejX        d          dO             Zz ejX        d          dP             Z{ej[        \                    dQdFdRg          ej[        \                    dSdTdUg          dV                         Z|dW Z}ej[        \                    dXdYdZg          d[             Z~d\ Zej[        \                    d]d^d_g          d`             Zda Zej[        \                    dbeeg          dc             Zej[        \                    dbeeg          dd             Zej[        \                    dedfd1dgdhdfd1dgdig          dj             Zej[        \                    dkg dl          dm             Zej[        \                    d#g d-          ej[        \                    d&d'd(g          dn                         Zej[        \                    dodpdqg          dr             Zej[        \                    dsdtgeWz   ej        eW          g          du             Zdv Zdw Zdx Zdy Zej[        \                    dzd'd(g          ej[        \                    d#g d-          d{                         Zd| Zej[        \                    d&d(d'g          ej[        \                    dzd(d'g          ej[        \                    d} eF            eC~          d                                     Zej[        \                    d&d(d'g          ej[        \                    dzd(d'g          ej[        \                    d} eF            eC~          d                                     ZdS )    N)assert_allclose)config_context)BaseEstimatorClassifierMixinclone)CalibratedClassifierCVCalibrationDisplay_CalibratedClassifier_sigmoid_calibration_SigmoidCalibration_TemperatureScalingcalibration_curve)	load_iris
make_blobsmake_classification)LinearDiscriminantAnalysis)DummyClassifier)RandomForestClassifierVotingClassifier)DictVectorizer)FrozenEstimator)SimpleImputer)IsotonicRegression)LogisticRegressionSGDClassifier)accuracy_scorebrier_score_losslog_lossroc_auc_score)KFoldLeaveOneOutcheck_cvcross_val_predictcross_val_scoretrain_test_split)MultinomialNB)Pipelinemake_pipeline)LabelEncoderStandardScaler)	LinearSVC)DecisionTreeClassifier)_convert_to_numpy_get_namespace_device_dtype_idsdeviceget_namespace)yield_namespace_device_dtype_combinations)CheckingClassifier)get_tags)_array_api_for_tests_convert_containerassert_almost_equalassert_array_almost_equalassert_array_equal)softmax)CSR_CONTAINERS)check_is_fitted   module)scopec                  >    t          t          dd          \  } }| |fS )N   *   	n_samples
n_featuresrandom_state)r   	N_SAMPLESXys     ~/var/www/html/bestrading.cuttalo.com/services/ml-inference/venv/lib/python3.11/site-packages/sklearn/tests/test_calibration.pydatarK   I   s#    qrRRRDAqa4K    c                     | \  }}d}t          j        t                    5  t          |                              ||           d d d            d S # 1 swxY w Y   d S )Nz%not sigmoid, isotonic, or temperaturemethod)pytestraises
ValueErrorr   fit)rK   rH   rI   invalid_methods       rJ   test_calibration_method_raisesrU   O   s    DAq<N	z	"	" @ @n55599!Q???@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @s   %AAAcsr_containerrO   sigmoidisotonicensembleTFc                    t           dz  }| \  }}t          j                            d                              |j                  }||                                z
  }|d |         |d |         |d |         }
}	}||d          ||d          }}t                                          ||	|
          }|	                    |          d d df         }t          ||j        dz   |          }t          j        t                    5  |                    ||           d d d            n# 1 swxY w Y   ||f ||           ||          ffD ]\  }}t          ||d|	          }|                    ||	|
           |	                    |          d d df         }t          ||          t          ||          k    sJ |                    ||	dz   |
           |	                    |          d d df         }t          ||           |                    |d|	z  dz
  |
           |	                    |          d d df         }t          ||           |                    ||	dz   dz  |
           |	                    |          d d df         }|d
k    rt          |d|z
             ct          ||          t          |dz   dz  |          k    sJ d S )N   rA   seedsizesample_weight   cvrY      rO   rd   rY   rW   )rF   nprandomRandomStateuniformr_   minr&   rS   predict_probar   rP   rQ   rR   r   r7   )rK   rO   rV   rY   rC   rH   rI   ra   X_trainy_trainsw_trainX_testy_testclfprob_pos_clfcal_clfthis_X_trainthis_X_testprob_pos_cal_clfprob_pos_cal_clf_relabeleds                       rJ   test_calibrationry   X   s   
 QIDAqI))r)22:::GGM	AEEGGA "#:I:*9*}ZiZ?XhWGyzz]AijjMFF //

gwh

G
GC$$V,,QQQT2L$SQVaZ(KKKG	z	"	"  Aq              
 
&	w		v!6!67& # #!k )VHUUU 	L'BBB"00==aaadC  558H$9
 9
 
 
 
 

 	L'A+XFFF%,%:%:;%G%G1%M"!"24NOOO 	L!g+/JJJ%,%:%:;%G%G1%M"!"24NOOO 	L7Q;!"38LLL%,%:%:;%G%G1%M"Y%&6<V8VWWWW $FL99<L!q "<= =     C# #s   D++D/2D/c                     | \  }}t          d          }|                    ||           |j        d         j        }t	          |t
                    sJ d S )Nr[   rd   r   )r   rS   calibrated_classifiers_	estimator
isinstancer+   )rK   rH   rI   	calib_clfbase_ests        rJ   "test_calibration_default_estimatorr      s[    DAq&!,,,IMM!Q03=Hh	*******rL   c                    | \  }}d}t          |          }t          ||          }t          |j        t                     sJ |j        j        |k    sJ |                    ||           |r|nd}t          |j                  |k    sJ d S )Nre   n_splitsrc   rb   )r    r   r~   rd   r   rS   lenr|   )rK   rY   rH   rI   splitskfoldr   expected_n_clfs           rJ   test_calibration_cv_splitterr      s     DAqF6"""E&%(CCCIilE*****< F****MM!Q'.VVQNy011^CCCCCCrL   c                    | \  }}t          d          }t          |d          }t          j        t          d          5  |                    ||           d d d            n# 1 swxY w Y   t          t                      d          }t          j        t          d          5  |                    ||           d d d            d S # 1 swxY w Y   d S )Ne   r   Trc   z$Requesting 101-fold cross-validationmatchz!LeaveOneOut cross-validation does)r    r   rP   rQ   rR   rS   r!   )rK   rH   rI   r   r   s        rJ   test_calibration_cv_nfoldr      sR   DAq3E&%$???I	z)O	P	P	P  a               '+--$GGGI	z)L	M	M	M  a                 s$   A%%A),A)(CCC)rW   rX   temperaturec                 >   t           dz  }| \  }}t          j                            d                              t          |                    }|d |         |d |         |d |         }	}}||d          }
t          d          }t          |||          }|                    |||	           |	                    |
          }|                    ||           |	                    |
          }t          j
                            ||z
            }|dk    sJ d S )	Nr[   rA   r\   r^   rE   )rO   rY   r`   皙?)rF   rg   rh   ri   rj   r   r+   r   rS   rl   linalgnorm)rK   rO   rY   rC   rH   rI   ra   rm   rn   ro   rp   r}   calibrated_clfprobs_with_swprobs_without_swdiffs                   rJ   test_sample_weightr      s     QIDAqI))r)22::A:GGM!":I:*9*}ZiZ?XhWGyzz]Fr***I+IfxXXXNwx@@@"0088M w(((%33F;;9>>-*::;;D#::::::rL   c                    | \  }}t          ||d          \  }}}}t          t                      t          d                    }	t	          |	|d|          }
|
                    ||           |
                    |          }t	          |	|d|          }|                    ||           |                    |          }t          ||           dS )zTest parallel calibrationrA   r   r[   )rO   n_jobsrY   rb   N)r%   r(   r*   r+   r   rS   rl   r   )rK   rO   rY   rH   rI   rm   rp   rn   rq   r}   cal_clf_parallelprobs_parallelcal_clf_sequentialprobs_sequentials                 rJ   test_parallel_executionr      s    
 DAq'712'N'N'N$GVWfn..	r0J0J0JKKI-&X   '***%33F;;N/&X   7G,,,)77??N$455555rL   r]   r[   c                    d }t          d          }t          dd|dd          \  }}d	||d	k    <   t          j        |          j        d
         }|d d d	         |d d d	         }	}|dd d	         |dd d	         }}
|                    ||	           t          || d|          }|                    ||	           |                    |
          }t          t          j	        |d          t          j
        t          |
                               d|                    |
|          cxk     rdk     sn J |                    |
|          d|                    |
|          z  k    sJ  ||t          |                    |
                    |          } ||||          }|d|z  k     sJ t          dd          }|                    ||	           |                    |
          } ||||          }t          || d|          }|                    ||	           |                    |
          } ||||          }|d|z  k     sJ d S )Nc                     t          j        |          |          }t          j        ||z
  dz            |j        d         z  S )Nr[   r   )rg   eyesumshape)y_true
proba_pred	n_classesY_onehots       rJ   multiclass_brierz5test_calibration_multiclass.<locals>.multiclass_brier   s<    6)$$V,vx*,233hnQ6GGGrL      r     d   
         .@rC   rD   rE   centerscluster_stdr[   r   rb   re   rf   axis?gffffff?)r   g?   rA   )n_estimatorsrE   )r+   r   rg   uniquer   rS   r   rl   r   r   onesr   scorer9   decision_functionr   )rO   rY   r]   r   rr   rH   rI   r   rm   rn   rp   rq   rt   probasuncalibrated_briercalibrated_brier	clf_probscal_clf_probss                     rJ   test_calibration_multiclassr      s   H H H 
#
#
#C#D"RV  DAq Aa!eH	!"1%I1vq1vWGqt!tWa1gFFGGGW$SAQQQGKK!!!""6**FBF6***BGCKK,@,@AAA
 #))FF++2222d222222 ==((4#))FF2K2K+KKKKK
 *)--f5566)   (')LLLc$666666 !br
B
B
BCGGGW!!&))I))&)yQQQ$SAQQQGKK!!!))&11M''SSSc$66666666rL   c                  0    G d d          } t          ddddd          \  }}t                                          ||          } |             }t          ||g|j                  }|                    |          }t          |d	|j        z             d S )
Nc                       e Zd Zd ZdS )9test_calibration_zero_probability.<locals>.ZeroCalibratorc                 @    t          j        |j        d                   S )Nr   )rg   zerosr   selfrH   s     rJ   predictzAtest_calibration_zero_probability.<locals>.ZeroCalibrator.predict:  s    8AGAJ'''rL   N)__name__
__module____qualname__r    rL   rJ   ZeroCalibratorr   8  s#        	( 	( 	( 	( 	(rL   r   2   r   r   r   r   )r}   calibratorsclasses      ?)r   r   rS   r
   classes_rl   r   
n_classes_)r   rH   rI   rr   
calibratorrt   r   s          rJ   !test_calibration_zero_probabilityr   3  s    
( ( ( ( ( ( ( (
 !RT  DAq 



1
%
%C!!J#J<  G ""1%%F FC#.011111rL   c           
      
   d}t          d|z  dd          \  }}t          j                            d                              |j                  }||                                z  }|d|         |d|         |d|         }}}||d	|z           ||d	|z           ||d	|z           }}
}	|d	|z  d         |d	|z  d         }}t                      }|                    |||           |	                    |          ddd
f         }|	|f | |	           | |          ffD ]\  }}t          t          |          |          }|dfD ]}|                    ||
|           |	                    |          }|                    |          }|ddd
f         }t          |t          j        dd
g          t          j        |d
                              t!          ||          t!          ||          k    sJ dS )z'Test calibration for frozen classifiersr      r@   rA   rB   r\   r^   Nr[   rb   rN   r`   r   r   )r   rg   rh   ri   rj   r_   rk   r&   rS   rl   r   r   r   r8   arrayargmaxr   )rV   rO   rC   rH   rI   ra   rm   rn   ro   X_caliby_calibsw_calibrp   rq   rr   rs   this_X_calibrv   cal_clf_frozenswy_prob_frozeny_pred_frozenprob_pos_cal_clf_frozens                          rJ   test_calibration_frozenr   L  so    IY1SUVVVDAqI))r)22:::GGMLA "#:I:*9*}ZiZ?XhWG	)a)m
#$	)a)m
#$i!i-/0 WG
 q9}'1y=??);FF //CGGGWh'''$$V,,QQQT2L 
&	w		v!6!67&  !k 00D0DVTTTT" 	 	B|WBGGG*88EEM*22;??M&3AAAqD&9#rxA//	-a0P0P0PQ   $FL99<L/= =     	 rL   r   clip)out_of_boundsr   c                    | \  }}t          d          }t          ||dd          }|                    ||           |                    |          }t	          |||dd          }|                    ||           |                    ||           |                    |          }	|                    |	          }
|dk    r(|
j        d	k    r|
j        d
         d	k    r|
d d d
f         }
t          |d d d
f         |
           d S )Nr   r   r   Frf   r   )rd   rO   r   r[   rb   )
r+   r   rS   rl   r#   r   r   ndimr   r   )rK   rO   r   rH   rI   rr   rt   
cal_probasunbiased_predsclf_dfmanual_probass              rJ   test_calibration_ensemble_falser   y  s     DAq

#
#
#C$SANNNGKK1&&q))J 'sAqQ?RSSSNNN>1%%%GGAqMMM""1%%F&&v..M!##-*=a*@A*E*E)!!!Q$/MJqqq!t$m44444rL   c                  |   t          j        g d          } t          j        g d          }t          j        ddg          }t          |t          | |          d           ddt          j        |d         | z  |d         z             z   z  }t                                          | |                              |           }t          ||d	           t          j	        t                    5  t                                          t          j        | | f          |           d
d
d
           d
S # 1 swxY w Y   d
S )z0Test calibration values with Platt sigmoid model)re   r   )rb   r   gj=ɿgY90(?r   r   r   rb   r@   N)rg   r   r7   r   expr   rS   r   rP   rQ   rR   vstack)exFexYAB_lin_libsvmlin_probsk_probs        rJ   test_sigmoid_calibrationr     sc   
(<<<
 
 C
(;;;

CH24GHIIMm-A#s-K-KQOOOcBF=#3c#9M!<L#LMMMNH!##''S1199#>>Gh333 
z	"	" > >!!")S#J"7"7===> > > > > > > > > > > > > > > > > >s   -7D11D58D5r   )r[   r   re   c           
      P   t          dddd| ddd          \  }}t          ||d          \  }}}}t          t          j        d	d
d          }|                    ||           t          t          |          dd|                              ||          }	|	j        }
|
D ]E}t          |j
                  dk    sJ |j
        d         }t          |           |j        dk    sJ F|s;|                    |          }|	                    |          }t          ||          t          ||          k    sJ |                    |          }|	                    |          }t!          ||          t!          ||          k    sJ | dk    r|dddf         }|dddf         }t#          t%          ||d          t%          ||d                     |                    |          }t'                                          ||          }t#          |j        ddd           dS dS )z%Check temperature scaling calibration  r   r   rb          @rA   rC   rD   n_informativen_redundantr   n_clusters_per_class	class_seprE   r   g:0yE>r<   )Ctolmax_iterrE   r   r   rd   rO   rY   r[   Novr)multi_classr   ư>)atolrtol)r   r%   r   rg   infrS   r   r   r|   r   r   r;   beta_r   r   rl   r   r   r   r   )r   rY   rH   rI   rm   X_calrn   y_calrr   rt   calibrated_classifierscalibrated_classifierr   y_pred
y_pred_caly_scoresy_scores_caly_scores_traintss                      rJ   test_temperature_scalingr    s{    	 	 	DAq &6a%L%L%L"GUGU
rv4#A
N
N
NCGGGW$=8  	c%  %<!7 	$ 	$ (455::::*6q9

###!##### :U##__U++
eZ00N5&4Q4QQQQQ $$U++,,U33|,,0I0IIIII
 >>1~H'1-L%u===%5AAA	
 	
 	
 **733 ""&&~w??#Dq9999995: :rL   c                    t          j        d                              |           }|                    dd          }t           j                            dd|j        d                   }t                                          ||          }t                                          ||          }t          |          t          |          k    sJ |
                    |          }|
                    |          }t          ||           d S )Nr   r   rb   r   r[   r^   )rg   arangeastypereshaperh   randintr   r   rS   r3   r   r   )global_dtyperH   X_2drI   r  ts_2dy_pred1y_pred2s           rJ   )test_temperature_scaling_input_validationr!    s    
	"\**A99RD
	!QQWQZ00A				"	"1a	(	(B!!%%dA..EB<<8E??****jjmmGmmD!!GGW%%%%%rL   c                     t          j        g d          } t          j        g d          }t          | |d          \  }}t          |          t          |          k    sJ t          |          dk    sJ t	          |ddg           t	          |ddg           t          j        t                    5  t          dgd	g           d
d
d
           n# 1 swxY w Y   t          j        g d          }t          j        g d          }t          ||dd          \  }}t          |          t          |          k    sJ t          |          dk    sJ t	          |ddg           t	          |ddg           t          j        t                    5  t          ||d           d
d
d
           d
S # 1 swxY w Y   d
S )z Check calibration_curve function)r   r   r   rb   rb   rb   )        r   皙?皙??r   r[   n_binsr   rb   r   r&  gN)r   r   r   r   rb   rb   )r#  r   r$        ?r&  r   quantiler(  strategygUUUUUU?r%  
percentile)r,  )rg   r   r   r   r6   rP   rQ   rR   )r   r  	prob_true	prob_predy_true2r   prob_true_quantileprob_pred_quantiles           rJ   test_calibration_curver3    sx   X((())FX44455F,VVAFFFIyy>>S^^++++y>>Q	Aq6***	C:... 
z	"	" ' '1#v&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' h)))**Gh55566G->Z. . .** !""c*<&=&=====!""a''''*QJ777*S#J777 
z	"	" C C'7\BBBBC C C C C C C C C C C C C C C C C Cs$   6CCCF66F:=F:c                 ,   t          ddddd          \  }}t          j        |d<   t          dt	                      fdt          d	
          fg          }t          |d| |          }|                    ||           |                    |           dS )z$Test that calibration can accept nanr   r[   r   rA   )rC   rD   r   r   rE   r   r   imputerrfrb   )r   r  N)	r   rg   nanr'   r   r   r   rS   r   )rO   rY   rH   rI   rr   clf_cs         rJ   test_calibration_nan_imputerr:  "  s     !QS  DAq fAdG

]__	%.DRS.T.T.T'UV C #31VhOOOE	IIaOOO	MM!rL   c                 6   t          ddd          \  }}g d}t          dd          }t          || t          d	
          |          }|                    ||           t          |                    |                              d          d           d S )Nr   re   r[   )rC   rD   r   )
rb   rb   rb   rb   rb   r   r   r   r   r   r   r   )r  rE   r   r   rf   rb   r   )r   r+   r   r    rS   r   rl   r   )rO   rY   rH   _rI   rr   clf_probs          rJ   test_calibration_prob_sumr>  2  s    
 QGGGDAq&&&A
c
*
*
*C%Fua0008  H LLAH**1--11q1993?????rL   c           	         t           j                            dd          }g dg dz   g dz   }t          d          }t	          |dt          d	          | 
          }|                    ||           | rt          j        d          }t          ddgdd	g          D ]\  }}|j	        |         
                    |          }t          |d d |f         t          j        t          |                               t          j        |d d ||k    f         dk              sJ d S |j	        d         
                    |          }t          |                    d          t          j        |j        d                              d S )N   re   )r   r   r   rb   )rb   rb   r[   r[   )r[   r   r   r   r   r   rW   r   rf      r   r[   rb   r   )rg   rh   randnr,   r   r    rS   r  zipr|   rl   r8   r   r   allr7   r   r   r   )	rY   rH   rI   rr   rt   r   calib_iclass_iprobas	            rJ   test_calibration_less_classesrH  B  s    		AA|||#lll2A
 a
0
0
0C$I%((X  G KK1 N)A,, #QFQF 3 3 	< 	<GW3G<JJ1MMEuQQQZ0"(3q662B2BCCC6%7g#5 56:;;;;;;	< 	< /2@@CC!%)))"3"3RWU[^5L5LMMMMMrL   rH   rA      re   r@   c                     g d} G d dt           t                    }t           |                      }|                    | |           dS )z;Test that calibration accepts n-dimensional arrays as input)rb   r   r   rb   rb   r   rb   rb   r   r   rb   r   r   rb   r   c                       e Zd ZdZd Zd ZdS )>test_calibration_accepts_ndarray.<locals>.MockTensorClassifierz*A toy estimator that accepts tensor inputsc                 8    t          j        |          | _        | S N)rg   r   r   )r   rH   rI   s      rJ   rS   zBtest_calibration_accepts_ndarray.<locals>.MockTensorClassifier.fitn  s    IaLLDMKrL   c                 l    |                     |j        d         d                              d          S )Nr   r   rb   r   )r  r   r   r   s     rJ   r   zPtest_calibration_accepts_ndarray.<locals>.MockTensorClassifier.decision_functionr  s-    99QWQZ,,00a0888rL   N)r   r   r   __doc__rS   r   r   rL   rJ   MockTensorClassifierrL  k  s8        88	 	 		9 	9 	9 	9 	9rL   rQ  N)r   r   r   rS   )rH   rI   rQ  r   s       rJ    test_calibration_accepts_ndarrayrR  `  sp     	655A	9 	9 	9 	9 	9 	9 	9 	9 ,,@,@,B,BCCNq!rL   c                  >    dddddddddddddddg} g d	}| |fS )
NNYadult)stateageTXVTchildCTBR)rb   r   rb   rb   r   r   )	dict_datatext_labelss     rJ   r]  r]  {  sX     w''w''w''w''w''I "//Kk!!rL   c                     | \  }}t          dt                      fdt                      fg          }|                    ||          S )N
vectorizerrr   )r'   r   r   rS   )r]  rH   rI   pipeline_prefits       rJ   dict_data_pipelinerb    sQ    DAq
((	)E3I3K3K+LM O q!$$$rL   c                 L   | \  }}|}t          t          |          d          }|                    ||           t          |j        |j                   t          |d          rJ t          |d          rJ |                    |           |                    |           dS )aR  Test that calibration works in prefit pipeline with transformer

    `X` is not array-like, sparse matrix or dataframe at the start.
    See https://github.com/scikit-learn/scikit-learn/issues/8710

    Also test it can predict without running into validation errors.
    See https://github.com/scikit-learn/scikit-learn/issues/19637
    r[   r{   n_features_in_N)r   r   rS   r8   r   hasattrr   rl   )r]  rb  rH   rI   rr   r   s         rJ   test_calibration_dict_pipelinerf    s     DAq
C&s';';BBBIMM!Qy)3<888 s,-----y"233333 aArL   c                  B   t          dddd          \  } }t          t          d          d          }|                    | |           t	                                          |          j        }t          |j        |           |j        | j        d         k    sJ d S )	Nr   re   r[   r   rC   rD   r   rE   rb   r  r{   )	r   r   r+   rS   r)   r   r8   rd  r   )rH   rI   r   r   s       rJ   test_calibration_attributesrj    s    QUVWWWDAq&y1~~~!<<<IMM!Qnn  ##,Gy)7333#qwqz111111rL   c                  b   t          dddd          \  } }t          d                              | |          }t          t	          |                    }d}t          j        t          |	          5  |                    | d d d d
f         |           d d d            d S # 1 swxY w Y   d S )Nr   re   r[   r   rh  rb   ri  zAX has 3 features, but LinearSVC is expecting 5 features as input.r   r   )r   r+   rS   r   r   rP   rQ   rR   )rH   rI   rr   r   msgs        rJ   2test_calibration_inconsistent_prefit_n_features_inrm    s     QUVWWWDAq
a...

Q
"
"C&s';';<<I
MC	z	-	-	- # #a2A2h"""# # # # # # # # # # # # # # # # # #s   4#B$$B(+B(c                     t          dddd          \  } }t          d t          d          D             d	          }|                    | |           t	          t          |          
          }|                    | |           d S )Nr   re   r[   r   rh  c                 N    g | ]"}d t          |          z   t                      f#S )lr)strr   ).0is     rJ   
<listcomp>z5test_calibration_votingclassifier.<locals>.<listcomp>  s.    LLLaTCFF]$6$8$89LLLrL   r   soft)
estimatorsvotingr}   )r   r   rangerS   r   r   )rH   rI   voter   s       rJ   !test_calibration_votingclassifierr{    s     QUVWWWDAqLL588LLL  D 	HHQNNN&1F1FGGGIMM!QrL   c                  "    t          d          S )NT
return_X_y)r   r   rL   rJ   	iris_datar    s    %%%%rL   c                 <    | \  }}||dk              ||dk              fS )Nr[   r   )r  rH   rI   s      rJ   iris_data_binaryr    s&    DAqQU8Qq1uXrL   r(  r   r,  rj   r*  c                    |\  }}t                                          ||          }t          j        |||||d          }|                    |          d d df         }t          ||||          \  }	}
t          |j        |	           t          |j        |
           t          |j	        |           |j
        dk    sJ dd l}t          |j        |j        j                  sJ |j                                        dk    sJ t          |j        |j        j                  sJ t          |j        |j        j                  sJ |j                                        dk    sJ |j                                        dk    sJ dd	g}|j                                                                        }t7          |          t7          |          k    sJ |D ]}|                                |v sJ d S )
Nr%  )r(  r,  alpharb   r+  r   r   z.Mean predicted probability (Positive class: 1)z)Fraction of positives (Positive class: 1)Perfectly calibrated)r   rS   r	   from_estimatorrl   r   r   r.  r/  y_probestimator_name
matplotlibr~   line_linesLine2D	get_alphaax_axesAxesfigure_figureFigure
get_xlabel
get_ylabel
get_legend	get_textsr   get_text)pyplotr  r(  r,  rH   rI   rp  vizr  r.  r/  mplexpected_legend_labelslegend_labelslabelss                  rJ    test_calibration_display_computer    s%    DAq				!	!!Q	'	'B

+
Aq(#  C a  A&F,	6&8  Iy CM9---CM9---CJ'''!55555 ci!1222229  C''''cgsx}-----ck3:#4555557#SSSSS7#NNNNN24JKG&&((2244M}%;!<!<<<<< ; ;  $::::::; ;rL   c                    |\  }}t          t                      t                                }|                    ||           t	          j        |||          }|j        dg}|j                                        	                                }t          |          t          |          k    sJ |D ]}|                                |v sJ d S )Nr  )r(   r*   r   rS   r	   r  r  r  r  r  r   r  )	r  r  rH   rI   rr   r  r  r  r  s	            rJ   $test_plot_calibration_curve_pipeliner    s    DAq
((*<*>*>
?
?CGGAqMMM

+CA
6
6C!02HIG&&((2244M}%;!<!<<<<< ; ;  $::::::; ;rL   zname, expected_label)N_line1)my_estr  c                    t          j        g d          }t          j        g d          }t          j        g           }t          ||||          }|                                 |g n|g}|                    d           |j                                                                        }t          |          t          |          k    sJ |D ]}	|		                                |v sJ d S )Nr   rb   rb   r   r$  r%  r%  皙?r  r  )
rg   r   r	   plotappendr  r  r  r   r  )
r  nameexpected_labelr.  r/  r  r  r  r  r  s
             rJ   'test_calibration_display_default_labelsr    s     &&I---..IXb\\F
Y	6$
O
O
OCHHJJJ#'<RRdV!!"8999G&&((2244M}%;!<!<<<<< ; ;  $::::::; ;rL   c                    t          j        g d          }t          j        g d          }t          j        g           }d}t          ||||          }|j        |k    sJ d}|                    |           |dg}|j                                                                        }t          |          t          |          k    sJ |D ]}|	                                |v sJ d S )Nr  r  zname oner  zname twor  r  )
rg   r   r	   r  r  r  r  r  r   r  )	r  r.  r/  r  r  r  r  r  r  s	            rJ   )test_calibration_display_label_class_plotr  )  s    &&I---..IXb\\FD
Y	6$
O
O
OC%%%%DHH$H"$:;G&&((2244M}%;!<!<<<<< ; ;  $::::::; ;rL   constructor_namer  from_predictionsc                    |\  }}d}t                                          ||          }|                    |          d d df         }t          t          |           }| dk    r|||fn||f}	 ||	d|i}
|
j        |k    sJ |                    d           |
                                 |dg}|
j        	                                
                                }t          |          t          |          k    sJ |D ]}|                                |v sJ |                    d           d}|
                    |           t          |          t          |          k    sJ |D ]}|                                |v sJ d S )	Nzmy hand-crafted namerb   r  r  rD  r  another_namer  )r   rS   rl   getattrr	   r  closer  r  r  r  r   r  )r  r  r  rH   rI   clf_namerr   r  constructorparamsr  r  r  r  s                 rJ   ,test_calibration_display_name_multiple_callsr  =  s    DAq%H



"
"1a
(
(Cq!!!!!Q$'F,.>??K,0@@@c1a[[q&kF
+v
-H
-
-C))))
LLHHJJJ&(>?G&&((2244M}%;!<!<<<<< ; ;  $::::::
LLHHH(H}%;!<!<<<<< ; ;  $::::::; ;rL   c                 r   |\  }}t                                          ||          }t                                          ||          }t          j        |||          }t          j        ||||j                  }|j                                        d         }|                    d          dk    sJ d S )N)axrb   r  )r   rS   r,   r	   r  r  get_legend_handles_labelscount)	r  r  rH   rI   rp  dtr  viz2r  s	            rJ   !test_calibration_display_ref_liner  `  s    DAq				!	!!Q	'	'B		!	!	%	%a	+	+B

+B1
5
5C,RA#'BBBDX//11!4F<<.//1444444rL   dtype_y_strc                 L   t           j                            d          }t          j        dgdz  dgdz  z   |           }|                    dd|j                  }d	}t          j        t          |
          5  t          ||           ddd           dS # 1 swxY w Y   dS )zKCheck error message when a `pos_label` is not specified with `str` targets.rA   spamr   eggsr[   dtyper   r^   zy_true takes value in {'eggs', 'spam'} and pos_label is not specified: either make y_true take value in {0, 1} or {-1, 1} or pass pos_label explicitlyr   N)
rg   rh   ri   r   r  r_   rP   rQ   rR   r   )r  rngy1y2err_msgs        rJ   *test_calibration_curve_pos_label_error_strr  m  s     )


#
#C	6(Q,&A-[	A	A	AB	Q	(	(B	$ 
 
z	1	1	1 " ""b!!!" " " " " " " " " " " " " " " " " "s   ;BB Bc                    t          j        g d          }t          j        ddg|           }||         }t          j        g d          }t          ||d          \  }}t          |g d           t          ||dd	          \  }}t          |g d           t          |d
|z
  dd	          \  }}t          |g d           t          |d
|z
  dd	          \  }}t          |g d           dS )z8Check the behaviour when passing explicitly `pos_label`.)	r   r   r   rb   rb   rb   rb   rb   rb   r  eggr  )	r   r$  g333333?r  r   gffffff?r%  r&  r   rA  r'  )r   r)  rb   rb   )r(  	pos_labelrb   r   )r   r   r)  rb   N)rg   r   r   r   )r  r   r   
y_true_strr  r.  r<  s          rJ    test_calibration_curve_pos_labelr  }  s    X11122Fhk:::GJXDDDEEF %VVA>>>LIqI~~~...$ZUSSSLIqI~~~...$VQZQOOOLIqI~~~...$ZVAQWXXXLIqI~~~.....rL   kwargsred-.)clwls)color	linewidth	linestylec                 6   |\  }}t                                          ||          }t          j        |||fi |}|j                                        dk    sJ |j                                        dk    sJ |j                                        dk    sJ dS )z*Check that matplotlib aliases are handled.r  r[   r  N)r   rS   r	   r  r  	get_colorget_linewidthget_linestyle)r  r  r  rH   rI   rp  r  s          rJ   test_calibration_display_kwargsr    s     DAq				!	!!Q	'	'B

+B1
?
?
?
?C9  E))))9""$$))))9""$$,,,,,,rL   zpos_label, expected_pos_label))Nrb   r5  )rb   rb   c                    |\  }}t                                          ||          }t          j        ||||          }|                    |          dd|f         }t          |||          \  }	}
t          |j        |	           t          |j        |
           t          |j	        |           |j
                                        d| dk    sJ |j
                                        d| dk    sJ |j        j        dg}|j
                                                                        }t#          |          t#          |          k    sJ |D ]}|                                |v sJ dS )z?Check the behaviour of `pos_label` in the `CalibrationDisplay`.)r  Nz,Mean predicted probability (Positive class: )z'Fraction of positives (Positive class: r  )r   rS   r	   r  rl   r   r   r.  r/  r  r  r  r  	__class__r   r  r  r   r  )r  r  r  expected_pos_labelrH   rI   rp  r  r  r.  r/  r  r  r  s                 rJ   "test_calibration_display_pos_labelr    s   
 DAq				!	!!Q	'	'B

+B1	
J
J
JCa  $6!67F,Q)LLLIyCM9---CM9---CJ''' 	O:LOOO	P 	P 	P 	P 	J5GJJJ	K 	K 	K 	K !l35KLG&&((2244M}%;!<!<<<<< ; ;  $::::::; ;rL   c                    t          d          \  }}t                                          |          }|dd         |dd         }}t          j        |          dz  }t          j        |j        d         dz  |j        d         f|j                  }||dddddf<   ||dddddf<   t          j        |j        d         dz  |j                  }||ddd<   ||ddd<   t                      }t          || |d	          }t          |          }	|	                    |||
           |                    ||           t          |	j        |j                  D ])\  }
}t          |
j        j        |j        j                   *|	                    |          }|                    |          }t          ||           dS )zrCheck that passing repeating twice the dataset `X` is equivalent to
    passing a `sample_weight` with a factor 2.Tr}  Nr   r[   r   rb   r  )rO   rY   rd   r`   )r   r*   fit_transformrg   	ones_liker   r   r  r   r   r   rS   rC  r|   r   r}   coef_rl   )rO   rY   rH   rI   ra   X_twicey_twicer}   calibrated_clf_without_weightscalibrated_clf_with_weightsest_with_weightsest_without_weightsy_pred_with_weightsy_pred_without_weightss                 rJ   ?test_calibrated_classifier_cv_double_sample_weights_equivalencer    s   
 %%%DAq&&q))ATcT7AdsdGqALOOa'M h
Q
317CCCGGCCaCFOGADqD!!!GhqwqzA~QW555GGCCaCLGADqDM"$$I%;	& & &" #((F"G"G##Aq#FFF"&&w888 25#;&>2 2 
 
-- 	&,)/	
 	
 	
 	
 6CCAFF;II!LL')?@@@@@rL   fit_params_typelistr   c                     |\  }}t          ||           t          ||           d}t          ddg          }t          |          } |j        ||fi | dS )zTests that fit_params are passed to the underlying base estimator.

    Non-regression test for:
    https://github.com/scikit-learn/scikit-learn/issues/12384
    )abr  r  )expected_fit_paramsN)r5   r2   r   rS   )r  rK   rH   rI   
fit_paramsrr   pc_clfs          rJ    test_calibration_with_fit_paramsr    sx     DAq?33?33 J
 #s
<
<
<C#C((FFJq!""z"""""rL   ra   r   c                 ~    |\  }}t          d          }t          |          }|                    |||            dS )zMTests that sample_weight is passed to the underlying base
    estimator.
    T)expected_sample_weightr`   N)r2   r   rS   )ra   rK   rH   rI   rr   r  s         rJ   -test_calibration_with_sample_weight_estimatorr    sH     DAq
D
9
9
9C#C((F
JJq!=J11111rL   c                 $   | \  }}t          j        |          } G d dt                    } |            }t          |          }t	          j        t                    5  |                    |||           ddd           dS # 1 swxY w Y   dS )zCheck that even if the estimator doesn't support
    sample_weight, fitting with sample_weight still works.

    There should be a warning, since the sample_weight is not passed
    on to the estimator.
    c                        e Zd Z fdZ xZS )Ptest_calibration_without_sample_weight_estimator.<locals>.ClfWithoutSampleWeightc                 F    d|vsJ  t                      j        ||fi |S )Nra   superrS   )r   rH   rI   r  r  s       rJ   rS   zTtest_calibration_without_sample_weight_estimator.<locals>.ClfWithoutSampleWeight.fit(  s4    "*4444577;q!22z222rL   r   r   r   rS   __classcell__r  s   @rJ   ClfWithoutSampleWeightr  '  s8        	3 	3 	3 	3 	3 	3 	3 	3 	3rL   r  r`   N)rg   r  r2   r   rP   warnsUserWarningrS   )rK   rH   rI   ra   r  rr   r  s          rJ   0test_calibration_without_sample_weight_estimatorr	    s     DAqLOOM3 3 3 3 3!3 3 3 3
 !
 
"
"C#C((F	k	"	" 6 6

1a}
5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6s   BB	B	c           
           G d dt                     } t           |                      j        | dt          j        t          | d                   dz             i dS )z[Check that CalibratedClassifierCV does not enforce sample alignment
    for fit parameters.c                         e Zd Zd fd	Z xZS )Jtest_calibration_with_non_sample_aligned_fit_param.<locals>.TestClassifierNc                 T    |J t                                          |||          S )Nr`   r  )r   rH   rI   ra   	fit_paramr  s        rJ   rS   zNtest_calibration_with_non_sample_aligned_fit_param.<locals>.TestClassifier.fit8  s+    (((77;;q!=;AAArL   )NNr  r  s   @rJ   TestClassifierr  7  sG        	B 	B 	B 	B 	B 	B 	B 	B 	B 	BrL   r  rx  r  rb   N)r   r   rS   rg   r   r   )rK   r  s     rJ   2test_calibration_with_non_sample_aligned_fit_paramr  3  s    B B B B B+ B B B
 ;^^%5%5666:	T!W!122    rL   c           	      V   d}d}t           j                            |                               |          }t          j        dgt          ||z            z  dg|t          ||z            z
  z  z             }d|                    d          z  |z   }t          d|d	
          }|                    ||          }|D ]s\  }}	||         ||         }}
||	         }t          d|           }|
                    |
|           |                    |          }|dk                                    sJ tt          t          d|           d          }t          |||d          }t          t          d|           d          }t          |||d          }t          ||           dS )zTest that :class:`CalibratedClassifierCV` works with large confidence
    scores when using the `sigmoid` method, particularly with the
    :class:`SGDClassifier`.

    Non-regression test for issue #26766.
    gq=
ףp?r   r^   rb   r   g     j@)r   rb   NT)rd   rI   
classifiersquared_hinge)lossrE   g     @rW   rN   roc_auc)scoringrX   )rg   rh   default_rngnormalr   intr  r"   splitr   rS   r   anyr   r$   r   )global_random_seedprobnrandom_noiserI   rH   rd   indicestraintestrm   rn   rp   sgd_clfpredictionsclf_sigmoidscore_sigmoidclf_isotonicscore_isotonics                      rJ   @test_calibrated_classifier_cv_works_with_large_confidence_scoresr)  A  s    DA9(();<<CCCKKL
!s1t8}}$sa#a$h--.?'@@AAAaii   </A 
TQ4	0	0	0Bhhq!nnG ) )tU8QuX4_CUVVVGW%%%//77c!&&((((((
 )?9KLLL  K $KAyIIIM *?9KLLL  L %\1aKKKN M>22222rL   c                    t           j                            |           }d}|                    dd|          }|                    ddd          }d}t          |||	          \  }}d
}t          |||	          \  }	}
t          ||          \  }}d}t          ||	|           t          |	||           t          ||
|           t          |
||           d S )Nr\   r   r   r[   r^   )lowhighr_   r   )r$  rI   max_abs_prediction_thresholdr   )r$  rI   r  )r  )rg   rh   ri   r  rj   r   r   )r  rE   r  rI   predictions_smallthreshold_1a1b1threshold_2a2b2a3b3r  s                 rJ   5test_sigmoid_calibration_max_abs_prediction_thresholdr8  s  s(   9((.@(AALAQ**A %,,!#,FF K!%
%0  FB K!%
%0  FB "%
  FB DB&&&&B&&&&B&&&&B&&&&&&rL   use_sample_weightc                 R   |r't          j        | d         t           j                  }nd} G d dt                    } |            }t	          ||          } |j        | d|i   |            j        | d|i}t	          t          |          |          } |j        | d|i dS )z|Check that CalibratedClassifierCV works with float32 predict proba.

    Non-regression test for gh-28245 and gh-28247.
    rb   r  Nc                        e Zd Z fdZ xZS )4test_float32_predict_proba.<locals>.DummyClassifer32c                     t                                          |                              t          j                  S rN  )r  rl   r  rg   float32)r   rH   r  s     rJ   rl   zBtest_float32_predict_proba.<locals>.DummyClassifer32.predict_proba  s+    77((++222:>>>rL   )r   r   r   rl   r  r  s   @rJ   DummyClassifer32r<    s8        	? 	? 	? 	? 	? 	? 	? 	? 	?rL   r?  rN   ra   )rg   r  float64r   r   rS   r   )rK   r9  rO   ra   r?  modelr   s          rJ   test_float32_predict_probarB    s       T!WBJ???? ? ? ? ?? ? ? ? E'f===JJND6666 #"DFFFE'(>(>vNNNJJND666666rL   c                      t           j                            d          } dgdz  dgdz  z   }t          d                              | |           dS )	zlCheck that CalibratedClassifierCV works with string targets.

    non-regression test for issue #28841.
    )   r   r^   r  r   r  r   r{   N)rg   rh   r  r   rS   rG   s     rJ   (test_error_less_class_samples_than_foldsrE    sY    
 		g&&A	
cURZAa   $$Q*****rL   z$array_namespace, device_, dtype_name)idsc           
         t          ||          }t          dddddddd          \  }}t          ||d	          \  }}	}
}|                    |          }|
                    |          }
|                    ||
          }|                    |
|
          }|	                    |          }	|                    |          }|                    |	|
          }|                    ||
          }|rt          j        |          }d|ddd<   nd}t                      }|                    ||
           t          t          |          dd|                               |	||          }|j        d         j        d         }|                    |          }t          d          5  t                      }|                    ||           t          t          |          dd|                               |||          }|j        d         j        d         }|dk    rdnd}t          |j                  d         j        |j        k    sJ |j        j        |j        k    sJ t'          |j                  t'          |          k    sJ t)          t+          |j        |          |j        |           |                    |          }t)          t+          ||          |           ddd           dS # 1 swxY w Y   dS )zaCheck that `CalibratedClassifierCV` with temperature scaling is compatible
    with the array APIr   r   r   re   rb   r   rA   r   r   r/   r[   Nr   r   r  r`   Tarray_api_dispatchr>  MbP?Hz>xpr	  )r4   r   r%   r  asarrayrg   r  r   rS   r   r   r|   r   r   r   r0   r  r   r  r/   r   r-   )rY   r9  array_namespacedevice_
dtype_namerN  rH   rI   rm   r  rn   r  
X_train_xp
y_train_xpX_cal_xpy_cal_xpra   clf_np
cal_clf_npcalibrator_nppred_npclf_xp
cal_clf_xpcalibrator_xpr	  pred_xps                             rJ   -test_temperature_scaling_array_api_compliancer`    s    
ow	7	7B	 	 	DAq &6a%L%L%L"GUGUnnZ((GnnZ((GGG44JGG44JLL$$ELL$$Ezz%z00Hzz%z00H U++add'))F
JJw   'Amh  	c%mc44  6q9EaHM  ))G	4	0	0	0 D D+--

:z***+F##-(
 
 

#h#
>
> 	 #:1=I!L!Y..ttD]011!4=LLLL"(HN::::m)**fX.>.>>>>>m1b999	
 	
 	
 	

 $$Z00)'b9997CCC%D D D D D D D D D D D D D D D D D Ds   *EK;;K?K?c           
      d   t          ||          }t          dddddddd          \  }}t          j        g d	          }|                    |          }||         }	|                    ||
          }
|rt          j        |          }d|ddd<   nd}t          t                      dd|                               ||	|          }|j	        d         j
        d         }|                    |          }t          d          5  t          t                      dd|                               |
|	|          }|j	        d         j
        d         }|dk    rdnd}t          |j                  d         j        |j        k    sJ |j        j        |
j        k    sJ t#          |j                  t#          |
          k    sJ t%          t'          |j        |          |j        |           |                    |
          }t)          ||           ddd           dS # 1 swxY w Y   dS )zCheck that `CalibratedClassifierCV` with temperature scaling is compatible
    with the array API when `y` is an ndarray of strings and the estimator is not
    fit beforehand (i.e. it is fit within `CalibratedClassifierCV`).
    r   r   r   re   rb   r   rA   r   )r  r  r  derH  r[   Nr   r   )r}   rd   rO   rY   r`   TrI  r>  rK  rL  rM  rO  )r4   r   rg   rP  r  r  r   r   rS   r|   r   r   r   r0   r  r   r  r/   r   r-   r8   )rY   r9  rQ  rR  rS  rN  rH   rI   str_mappingy_strX_xpra   rY  rZ  r[  r]  r^  r	  r_  s                      rJ   Btest_temperature_scaling_array_api_with_str_y_estimator_not_prefitrg    s   & 
ow	7	7B	 	 	DAq *66677K	ANE::a:((D Qadd',..	  
 
c!U-c00  6q9EaHM  ##G	4	0	0	0 - -+022 	
 
 

 #dE#
7
7 	 #:1=I!L!Y..ttD]011!4=LLLL"(DJ6666m)**fTll::::m1b999	
 	
 	
 	

 $$T**7G,,,'- - - - - - - - - - - - - - - - - -s   DH%%H),H))numpyrg   rP   numpy.testingr   sklearnr   sklearn.baser   r   r   sklearn.calibrationr   r	   r
   r   r   r   r   sklearn.datasetsr   r   r   sklearn.discriminant_analysisr   sklearn.dummyr   sklearn.ensembler   r   sklearn.feature_extractionr   sklearn.frozenr   sklearn.imputer   sklearn.isotonicr   sklearn.linear_modelr   r   sklearn.metricsr   r   r   r   sklearn.model_selectionr    r!   r"   r#   r$   r%   sklearn.naive_bayesr&   sklearn.pipeliner'   r(   sklearn.preprocessingr)   r*   sklearn.svmr+   sklearn.treer,   sklearn.utils._array_apir-   r.   r/   r0   r1   sklearn.utils._mockingr2   sklearn.utils._tagsr3   sklearn.utils._testingr4   r5   r6   r7   r8   sklearn.utils.extmathr9   sklearn.utils.fixesr:   sklearn.utils.validationr;   rF   fixturerK   rU   markparametrizery   r   r   r   r   thread_unsafer   ry  r   r   r   r   r   r  r!  r3  r:  r>  rH  rh   ri   rB  rR  r]  rb  rf  rj  rm  r{  r  r  r  r  r  r  r  r  rq  objectr  r  r  r  r  r  r   r  r	  r  r)  r8  rB  rE  r`  rg  r   rL   rJ   <module>r     s        ) ) ) ) ) ) " " " " " " > > > > > > > > > >                  H G G G G G G G G G D D D D D D ) ) ) ) ) )        6 5 5 5 5 5 * * * * * * ( ( ( ( ( ( / / / / / / B B B B B B B B                           . - - - - - 4 4 4 4 4 4 4 4 > > > > > > > > ! ! ! ! ! ! / / / / / /              6 5 5 5 5 5 ( ( ( ( ( (              * ) ) ) ) ) . . . . . . 4 4 4 4 4 4	 h   
@ @ @ .99Iz#:;;dE]338 8 43 <; :98v+ + + dE]33D D 43D   #I#I#IJJdE]33  43 KJ0 #I#I#IJJdE]336 6 43 KJ 6, Iz#:;;dE]33 q**:7 :7 +* 43 <;
:7z2 2 22 .99#I#I#IJJ( ( KJ :9(V |	''))*	''f===>	++--. 5 5 54> > >" II  	5M ;: ;:	 	 ;:|& & &"C C C> #I#I#IJJdE]33  43 KJ #I#I#IJJdE]33@ @ 43 KJ@ dE]33N N 43N: 
	b!!''Aq11
	b!!''Aq!44   ( 	" 	" 	" % % %  42 2 2	# 	# 	#    h& &  & h   
 Ar7++i%<==&; &; >= ,+&;R; ; ; -/CD ; ; ; ; ; ;( +.>@R-STT; ; UT;D
5 
5 
5 f66" " 76" f66/ / 76/( 1D))ad;; 	- 	- 	- 8:U:U:UVV; ; WV;@ #I#I#IJJdE]33-A -A 43 KJ-A` *VW,=>># # ?>#$ 			 2 2 26 6 6,  /3 /3 /3d&' &' &'R ,tUm<<#I#I#IJJ7 7 KJ =<7D+ + + eT]33,udm<<*--//'   
=D =D  =< 43=D@ eT]33,udm<<*--//'   
>- >-  =< 43>- >- >-rL   