U
    ½mœd8m  ã                
   @   sÚ  d Z ddlZddlZddlZddlZddlmZ ddlZddl	m
Z
 ddlmZmZmZ ddlmZmZ ddlmZ ddlmZ dd	lmZmZmZmZ d
d„ Ze ddddddg¡jZe dddddg¡jZeeƒ  ¡ Z!eddd�Z"edd�e"eddd�eddƒeddd� eddƒeddd� eddƒ eddƒeddd� eddƒ gZ#dd „ e#D ƒZ$ej% &d!e#¡d"d#„ ƒZ'd$d%„ Z(ej% &d!e$¡d&d'„ ƒZ)ej% &d!e#¡d(d)„ ƒZ*ej% &d!e#¡d*d+„ ƒZ+ej% &d!e$¡d,d-„ ƒZ,ej% &d!e$¡d.d/„ ƒZ-ej% &d!e#¡d0d1„ ƒZ.ej% &d!e#¡d2d3„ ƒZ/ej% &d!e#¡d4d5„ ƒZ0d6d7„ Z1ej% &d!e#¡ej% &d8e!ej2ej3d ej4d9�g¡d:d;„ ƒƒZ5d<d=„ Z6d>d?„ Z7ej% &d!e#¡d@dA„ ƒZ8dBdC„ Z9dDdE„ Z:ej% &d!e$¡dFdG„ ƒZ;dHdI„ Z<ej% &d!e#¡dJdK„ ƒZ=dLdM„ Z>dNdO„ Z?dPdQ„ Z@ej% &d!e#¡dRdS„ ƒZAdTdU„ ZBej% &dVdWe CdX¡ieDdYfeejE ejEfdZ�d[d\œeDd]fg¡d^d_„ ƒZFd`da„ ZGdbdc„ ZHej% &dddedfg¡ej% &dgddhdig¡djdk„ ƒƒZIej% &dddedfg¡ej% &dgddhdig¡dldm„ ƒƒZJG dndo„ doeƒZKdpdq„ ZLdS )rz(Testing for Gaussian process regression é    N)Úapprox_fprime)ÚGaussianProcessRegressor)ÚRBFÚConstantKernelÚWhiteKernel)Ú
DotProductÚExpSineSquared)ÚMiniSeqKernel)ÚConvergenceWarning)Úassert_array_lessÚassert_almost_equalÚassert_array_almost_equalÚassert_allclosec                 C   s   | t  | ¡ S )N)ÚnpÚsin)Úx© r   ú`/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/sklearn/gaussian_process/tests/test_gpr.pyÚf!   s    r   ç      ð?g      @g      @g      @g      @g       @ç       @g      @g      @g      @g      @Úfixed©Úlength_scaleÚlength_scale_bounds©r   )çü©ñÒMbP?ç     @�@©ç{®Gáz„?ç      Y@çñhãˆµøä>)r!   r    çš™™™™™¹?c                 C   s   g | ]}|t kr|‘qS r   )Úfixed_kernel)Ú.0Úkernelr   r   r   Ú
<listcomp>4   s      r&   r%   c                 C   sV   t jdkrt d¡ t| d� tt¡}|jtdd�\}}t	|tƒ t	t
 |¡dƒ d S )Nì        ú#This test may fail on 32 bit Python©r%   T©Ú
return_covç        )ÚsysÚmaxsizeÚpytestÚxfailr   ÚfitÚXÚyÚpredictr   r   Údiag)r%   ÚgprÚy_predÚy_covr   r   r   Útest_gpr_interpolation7   s    


r9   c                  C   s’   t dd�} dddg}t dddg¡}t| d	� ||¡}|j|d
d�\}}t| |d
d�d  ¡ dt t	|ƒ¡  ¡ ƒ t||ƒ tt 
|¡dƒ d S )Nr   )Zbaseline_similarity_boundsÚAÚBÚCé   é   é   r)   Tr*   ©Zeval_gradientr,   )r	   r   Úarrayr   r1   r4   r   ÚravelÚeyeÚlenr5   )r%   r2   r3   r6   r7   r8   r   r   r   Ú!test_gpr_interpolation_structuredD   s    

 ÿ
rE   c                 C   sH   t jdkrt d¡ t| d� tt¡}| |j	j
¡| | j
¡ksDt‚d S )Nr'   r(   r)   )r-   r.   r/   r0   r   r1   r2   r3   Úlog_marginal_likelihoodÚkernel_ÚthetaÚAssertionError©r%   r6   r   r   r   Útest_lml_improvingS   s    

ÿrK   c                 C   s6   t | d� tt¡}| |jj¡t | ¡ ¡ks2t	‚d S )Nr)   )
r   r1   r2   r3   rF   rG   rH   r/   ÚapproxrI   rJ   r   r   r   Útest_lml_precomputed_   s    ÿrM   c                 C   sJ   t | d� tt¡}tj|jjjtj	d�}|j
|dd� t|jj|dƒ d S )Nr)   ©ÚdtypeF)Zclone_kernelé   )r   r1   r2   r3   r   ÚonesrG   rH   ÚshapeÚfloat64rF   r   )r%   r6   Zinput_thetar   r   r   Útest_lml_without_cloning_kernelh   s    rT   c                 C   sz   t | d� tt¡}| |jjd¡\}}t t 	|¡dk |jj|jj
d d …df kB |jj|jj
d d …df kB ¡svt‚d S )Nr)   Tç-Cëâ6?r   r=   )r   r1   r2   r3   rF   rG   rH   r   ÚallÚabsÚboundsrI   )r%   r6   ÚlmlÚlml_gradientr   r   r   Útest_converged_to_local_maximumr   s    ÿþÿr[   c                 C   s�   t | d� tt¡}|jj}t |jjj	¡j
}d}||t |d d …df ¡ df< t|d d …df |jj| ƒ t|jj|d d …df | ƒ d S )Nr)   ç»½×Ùß|Û=r=   r   )r   r1   r2   r3   rG   rX   r   ÚfinforH   rO   ÚmaxÚisfiniter   )r%   r6   rX   Zmax_Ztinyr   r   r   Útest_solution_inside_bounds€   s     r`   c                    sJ   t | d� tt¡‰ ˆ  | jd¡\}}t| j‡ fdd„dƒ}t||dƒ d S )Nr)   Tc                    s   ˆ   | d¡S )NF)rF   )rH   ©r6   r   r   Ú<lambda>•   ó    z#test_lml_gradient.<locals>.<lambda>r\   r?   )r   r1   r2   r3   rF   rH   r   r   )r%   rY   rZ   Zlml_gradient_approxr   ra   r   Útest_lml_gradientŽ   s     
 ÿrd   c                 C   sn   t | d�}|jtdd�\}}t|ddƒ t|jjƒdkrXtt |¡t 	| jd ¡dƒ ntt |¡ddƒ d S )Nr)   Tr*   r   é   r=   )
r   r4   r2   r   rD   r%   rH   r   r5   Úexp)r%   r6   Úy_meanr8   r   r   r   Ú
test_prior›   s    
 rh   c                 C   s~   t | d� tt¡}|jtdd�\}}| td¡}t|t 	|d¡dƒ tt 
|¡t 
|¡ ¡  t |d¡t 
|¡ ¡  dƒ d S )Nr)   Tr*   ià“ r=   )r   r1   r2   r3   r4   ÚX2Úsample_yr   r   Úmeanr5   r^   Úvar)r%   r6   rg   r8   Zsamplesr   r   r   Útest_sample_statisticsª   s    ýrm   c                  C   s6   t dƒ} t| d d� tt¡}t |jj¡dks2t	‚d S )Nr   ©r%   Ú	optimizer)
r   r   r1   r2   r3   r   rf   rG   rH   rI   rJ   r   r   r   Útest_no_optimizer¼   s    rp   ÚtargetrN   c                 C   sd   t jdkrt d¡ t| d� tt¡}|jt	dd�\}}|jt	dd�\}}t
t t |¡¡|ƒ d S )Nr'   r(   r)   Tr*   ©Ú
return_std)r-   r.   r/   r0   r   r1   r2   r3   r4   ri   r   r   Úsqrtr5   )r%   rq   r6   rg   r8   Úy_stdr   r   r   Útest_predict_cov_vs_stdÃ   s    

rv   c                  C   sŒ   t j d¡} |  ddd¡}|d d …df d|d d …df   }tddgƒ}t|d� ||¡}t  |jj	d ¡t  |jj	d ¡d ksˆt
‚d S )	Nr   éÿÿÿÿr=   )é2   r>   r"   r   r)   re   )r   ÚrandomÚRandomStateÚuniformr   r   r1   rf   rG   rH   rI   )Úrngr2   r3   r%   r6   r   r   r   Útest_anisotropic_kernelÐ   s    $r}   c            
      C   sè   d\} }t j d¡}| | |¡d d }t  |¡jdd�t  d| ¡jdd� |jd| d� }td	d
ƒtd	g| dg| d� t	ddd� }t j
 }tdƒD ]F}t||dd� ||¡}| |jj¡}	|	|t  t j¡j ksÞt‚|	}qœd S )N)é   r>   r   r>   r=   ©Zaxisr?   r"   )ÚscaleÚsizer   r   )rU   r    r   r!   )r!   ç      $@)Únoise_levelÚnoise_level_boundsre   )r%   Ún_restarts_optimizerZrandom_state)r   ry   rz   Úrandnr   ÚsumÚnormalr<   r   r   ÚinfÚranger   r1   rF   rG   rH   r]   Zfloat32ZepsrI   )
Ú	n_samplesÚ
n_featuresr|   r2   r3   r%   Zlast_lmlr…   ÚgprY   r   r   r   Útest_random_startsÞ   s8    ÿþÿ
 ÿ
þý ürŽ   c                 C   sØ   t  t¡}t  t¡}t| | }t| d�}| t|¡ t| dd�}| tt¡ |jtdd�\}}|| | }|| }|jtdd�\}}	t	||ƒ t	||	ƒ |jtdd�\}
}||d  }|jtdd�\}
}t	||ƒ dS )a  
    Test normalization of the target values in GP

    Fitting non-normalizing GP on normalized y and fitting normalizing GP
    on unnormalized y should yield identical results. Note that, here,
    'normalized y' refers to y that has been made zero mean and unit
    variance.

    r)   T©r%   Únormalize_yrr   r*   r>   N)
r   rk   r3   Ústdr   r1   r2   r4   ri   r   )r%   rg   ru   Zy_normr6   Zgpr_normr7   Ú
y_pred_stdZy_pred_normZy_pred_std_normÚ_r8   Z
y_cov_normr   r   r   Útest_y_normalizationù   s"    




r”   c                  C   s�   dt  } ddi}tf |Ž}t|dd�}| t| ¡ |jtdd�\}}t ddd	d
dg¡}t dddddg¡}t	||ddd� t	||ddd� dS )a–  
    Here we test that, when noramlize_y=True, our GP can produce a
    sensible fit to training data whose variance is significantly
    larger than unity. This test was made in response to issue #15612.

    GP predictions are verified against predictions that were made
    using GPy which, here, is treated as the 'gold standard'. Note that we
    only investigate the RBF kernel here, as that is what was used in the
    GPy implementation.

    The following code can be used to recreate the GPy data:

    --------------------------------------------------------------------------
    import GPy

    kernel_gpy = GPy.kern.RBF(input_dim=1, lengthscale=1.)
    gpy = GPy.models.GPRegression(X, np.vstack(y_large), kernel_gpy)
    gpy.optimize()
    y_pred_gpy, y_var_gpy = gpy.predict(X2)
    y_pred_std_gpy = np.sqrt(y_var_gpy)
    --------------------------------------------------------------------------
    é
   r   r   Tr�   rr   gÀÆy(ŸV.@gV],±ü;Àg6çž}~¨CÀgåHÂW-@g¸Æ ×KQ@gØ¼G‰'@gùsár‚§@g{Üu>5ä?g÷	ÚÃâàà?gÐ.[Â“ë?gìQ¸…ë±?r   )ÚrtolÚatolg333333Ã?N)
r3   r   r   r1   r2   r4   ri   r   rA   r   )Zy_largeZ
RBF_paramsr%   r6   r7   r’   Z
y_pred_gpyZy_pred_std_gpyr   r   r   Útest_large_variance_y!  s    
ÿÿr˜   c                  C   sº  t  ttd f¡j} tdd�}t|d dd�}| tt¡ t|d dd�}| t| ¡ |jt	dd�\}}|jt	dd�\}}|jt	dd�\}}	|jt	dd�\}}
t
||d d …d	f ƒ t
||d d …d
f d ƒ t| jd
 ƒD ](}t
||d|f ƒ t
|	|
d|f ƒ qØ|jt	dd�}|jt	dd�}|jdk�s.t‚|jdk�s>t‚t
||d d …d	d d …f ƒ tD ]V}t|dd�}| tt¡ t|dd�}| tt  ttf¡j¡ t
|jj|jjdƒ �q^d S )Nr>   r   r   F)r%   ro   r�   Trr   r*   r   r=   .r•   ©r‹   )re   r•   )re   r>   r•   r�   é   )r   Úvstackr3   ÚTr   r   r1   r2   r4   ri   r   rŠ   rR   rj   rI   ÚkernelsrG   rH   )Zy_2dr%   r6   Zgpr_2dZ	y_pred_1dZy_std_1dZ	y_pred_2dZy_std_2dr“   Zy_cov_1dZy_cov_2drq   Zy_sample_1dZy_sample_2dr   r   r   Útest_y_multioutputX  s4    
rž   c                 C   sD   dd„ }t | |d�}| tt¡ | |jj¡| |jj¡ks@t‚d S )Nc           	      S   sŒ   t j d¡}|| |dd� }}tdƒD ]\}t  | t  d|d d …df ¡t  d|d d …df ¡¡¡}| |dd�}||k r&|| }}q&||fS )Nr   Fr@   rx   éþÿÿÿr=   )r   ry   rz   rŠ   Z
atleast_1dr{   ÚmaximumÚminimum)	Zobj_funcZinitial_thetarX   r|   Z	theta_optZfunc_minr“   rH   r   r   r   r   ro   Š  s     ÿ
2ÿz(test_custom_optimizer.<locals>.optimizerrn   )	r   r1   r2   r3   rF   rG   rH   r%   rI   )r%   ro   r6   r   r   r   Útest_custom_optimizer†  s    ÿr¢   c               	   C   sj   t  d¡ dd¡} t  d¡}tƒ }t|dd�}d| }tjt jj	t
 |¡d�� | | |¡ W 5 Q R X d S )Né   é   rw   r,   ©r%   Úalphaz—The kernel, %s, is not returning a positive definite matrix. Try gradually increasing the 'alpha' parameter of your GaussianProcessRegressor estimator.©Úmatch)r   ZarangeZreshaperQ   r   r   r/   ÚraisesZlinalgZLinAlgErrorÚreÚescaper1   )r2   r3   r%   r6   Úmessager   r   r   Útest_gpr_correct_error_message   s    
ýÿr­   c           
      C   sÚ   t | dd�}t | dd�}t ttd f¡}t ttd d f¡}| ||¡ t ttd d f¡}t ttd d f¡}| ||¡ t ddd¡d d …d f }|j|dd	�\}}|j|dd	�\}}	t	||ƒ t	||	ƒ d S )
Nr   r¥   r   r=   gVçž¯Ò<r•   éd   Trr   )
r   r   r›   r2   Zhstackr3   r1   Zlinspacer4   r   )
r%   Zgpr_equal_inputsZgpr_similar_inputsZX_Zy_ÚX_testZy_pred_equalZy_std_equalZy_pred_similarZy_std_similarr   r   r   Útest_duplicate_input¯  s    
r°   c                  C   sˆ   t ddd�tddd� } tƒ }|jtdd�\}}|jtdd�\}}t| d�}|jtdd�\}}|jtdd�\}}t||ƒ t||ƒ d S )	Nr   r   )Zconstant_value_bounds©r   Trr   r*   r)   )r<   r   r   r4   r2   r   )Zdefault_kernelZgpr1r“   Zy_std1Zy_cov1Zgpr2Zy_std2Zy_cov2r   r   r   Útest_no_fit_default_predictÅ  s     ÿ

r²   c            	   	   C   sÌ  t ddgd�} t| d�}d}tjt|d�� | tt¡ W 5 Q R X tddgd�t dd	gd� }t|d�}t	j
d
d��„}t	 d¡ | tt¡ t|ƒdksœt‚t|d jtƒs°t‚|d jjd dksÈt‚t|d jtƒsÜt‚|d jjd dksôt‚W 5 Q R X t td¡}t ddgddgd�}t|d�}t	j
d
d��Ž}t	 d¡ | |t¡ t|ƒdk�s^t‚t|d jtƒ�stt‚|d jjd dk�sŽt‚t|d jtƒ�s¤t‚|d jjd dk�s¾t‚W 5 Q R X d S )Nr!   r   r±   r)   z²The optimal value found for dimension 0 of parameter length_scale is close to the specified upper bound 0.001. Increasing the bound and calling fit again may find a better value.r§   ©r„   r   g     jø@T)ÚrecordÚalwaysr>   r   zµThe optimal value found for dimension 0 of parameter k1__noise_level is close to the specified upper bound 0.001. Increasing the bound and calling fit again may find a better value.r=   z·The optimal value found for dimension 0 of parameter k2__length_scale is close to the specified lower bound 1000.0. Decreasing the bound and calling fit again may find a better value.r   r   r‚   r    r   z±The optimal value found for dimension 0 of parameter length_scale is close to the specified lower bound 10.0. Decreasing the bound and calling fit again may find a better value.z±The optimal value found for dimension 1 of parameter length_scale is close to the specified lower bound 10.0. Decreasing the bound and calling fit again may find a better value.)r   r   r/   Zwarnsr
   r1   r2   r3   r   ÚwarningsÚcatch_warningsÚsimplefilterrD   rI   Ú
issubclassÚcategoryr¬   Úargsr   Ztile)	r%   r6   Zwarning_messageZ
kernel_sumZgpr_sumr´   ZX_tileZkernel_dimsZgpr_dimsr   r   r   Útest_warning_boundsÖ  sR    
ÿÿ

ÿÿ
ÿÿ


ÿÿ
ÿÿr¼   c                  C   s:   dt dd� } tdddd�}| | }t|d� tt¡ d S )Ng     ˆ£@g      I@r   r   r   )r   ZperiodicityZperiodicity_boundsr)   )r   r   r   r1   r2   r3   )Zk1Zk2r%   r   r   r   Ú%test_bound_check_fixed_hyperparameter#  s      ÿr½   c                 C   s4  t jtjd t jd�}t| dd�}| t|¡ |jt 	d¡ksBt
‚|jtdd�\}}t||ƒ tt  |¡ddd	� tjd d
 }}t j d¡}t j|j|dfd�t j|dfd
d�gdd�}| t|¡ |jtdd�\}	}
t|	dd…df d
ƒ tt  |
d ¡ddd	� |	j||fk�st
‚|
j|||fk�s0t
‚dS )a  Check that the std. dev. is affected to 1 when normalizing a constant
    feature.
    Non-regression test for:
    https://github.com/scikit-learn/scikit-learn/issues/18318
    NaN where affected to the target when scaling due to null std. dev. with
    constant target.
    r   rN   Tr�   r   r*   r,   g•Ö&è.>)r—   r>   r=   )r�   )rR   Z
fill_valuer   N).r=   )r   rQ   r2   rR   rS   r   r1   Z_y_train_stdr/   rL   rI   r4   r   r5   ry   rz   Zconcatenaterˆ   Úfull)r%   Z
y_constantr6   r7   r8   r‹   Ú	n_targetsr|   r3   ZY_predZY_covr   r   r   Útest_constant_target/  s*    	
þûrÀ   c            	   	   C   sð   t ddƒtddgdƒ tdd� } t| ddd	�}t d
d
gddgdd
gd
dgddgddgg¡}t dgdgdgdgdgdgg¡}| ||¡ t ddgddgddgddgg¡}|j|dd�\}}|j|dd�\}}t|t 	t 
|¡¡dd� dS )a
  Check the consistency between the returned std. dev. and the covariance.
    Non-regression test for:
    https://github.com/scikit-learn/scikit-learn/issues/19936
    Inconsistencies were observed when the kernel cannot be inverted (or
    numerically stable).
    gTã¥ l+A)gê-�™—q=g   ¢”mBgë‹„¶œz‚@gØG§®\·”@r!   )rƒ   r   N)r%   r¦   ro   r,   g6²§ô~Éø?g6²§ô~Éè¿g6²§ô~Éø¿g6²§ô~Éè?g6‡´$}ˆí½g±NøÕ­Àg¼Hx­@gR•|=Ùô¿gd-Ói¼¸õ¿gžŸ^ L
@gÖz°Þûþ¿gÖz°Þûþ?Trr   r*   )r–   )r<   r   r   r   r   rA   r1   r4   r   rt   Zdiagonal)	r%   r6   ÚX_trainÚy_trainr¯   Zpred1r‘   Zpred2Zcovr   r   r   Ú2test_gpr_consistency_std_cov_non_invertible_kernelX  sH    
 ÿþúÿ
úÿ
üÿrÃ   zparams, TypeError, err_msgr¦   r®   zCalpha must be a scalar or an array with same number of entries as yr³   r>   )r%   r…   z#requires that all bounds are finitec              	   C   s4   t f | Ž}tj||d�� | tt¡ W 5 Q R X dS )z0Check that expected error are raised during fit.r§   N)r   r/   r©   r1   r2   r3   )ÚparamsÚ	TypeErrorÚerr_msgr6   r   r   r   Útest_gpr_fit_error…  s    
rÇ   c               	   C   sB   t tƒ d� tt¡} d}tjt|d�� | jdd� W 5 Q R X dS )z7Check that we raise the proper error in the LML method.r)   z.Gradient can only be evaluated for theta!=Noner§   Tr@   N)	r   r   r1   r2   r3   r/   r©   Ú
ValueErrorrF   ©r6   rÆ   r   r   r   Útest_gpr_lml_errorž  s    rÊ   c               	   C   sF   t tƒ d� tt¡} d}tjt|d�� | jtddd� W 5 Q R X dS )z4Check that we raise the proper error during predict.r)   z9At most one of return_std or return_cov can be requested.r§   T)r+   rs   N)	r   r   r1   r2   r3   r/   r©   ÚRuntimeErrorr4   rÉ   r   r   r   Útest_gpr_predict_error§  s    rÌ   r�   TFr¿   r=   r•   c                 C   sÞ   t j d¡}d\}}}|f}|dk	r.||f }|f}|dk	rN|dkrN||f }| ||¡}| ||¡}	|j|Ž }
t| d�}| ||
¡ |j|	dd�\}}|j|	dd�\}}|j|ks¸t‚|j|ksÆt‚|j|f| ksÚt‚dS )	a´  Check the shapes of y_mean, y_std, and y_cov in single-output
    (n_targets=None) and multi-output settings, including the edge case when
    n_targets=1, where the sklearn convention is to squeeze the predictions.

    Non-regression test for:
    https://github.com/scikit-learn/scikit-learn/issues/17394
    https://github.com/scikit-learn/scikit-learn/issues/18065
    https://github.com/scikit-learn/scikit-learn/issues/22174
    éÒ  )r¤   é	   rP   Nr=   ©r�   Trr   r*   )	r   ry   rz   r†   r   r1   r4   rR   rI   )r�   r¿   r|   rŒ   Ún_samples_trainZn_samples_testÚy_train_shapeÚy_test_shaperÁ   r¯   rÂ   Úmodelr7   ru   r“   r8   r   r   r   Útest_predict_shapes°  s$    




rÔ   c                 C   s°   t j d¡}d\}}d}d}|f}|dk	r4||f }|dk	rP|dkrP|||f}n||f}| ||¡}	| ||¡}
|j|Ž }t| d�}| |	|¡ |j|
|d�}|j|ks¬t‚dS )	a&  Check the shapes of y_samples in single-output (n_targets=0) and
    multi-output settings, including the edge case when n_targets=1, where the
    sklearn convention is to squeeze the predictions.

    Non-regression test for:
    https://github.com/scikit-learn/scikit-learn/issues/22175
    rÍ   )r¤   rÎ   rP   re   Nr=   rÏ   r™   )	r   ry   rz   r†   r   r1   rj   rR   rI   )r�   r¿   r|   rŒ   rÐ   Zn_samples_X_testZn_samples_y_testrÑ   rÒ   rÁ   r¯   rÂ   rÓ   Z	y_samplesr   r   r   Útest_sample_y_shapesØ  s"    




rÕ   c                   @   s   e Zd ZdZdd„ ZdS )ÚCustomKernelz¼
    A custom kernel that has a diag method that returns the first column of the
    input matrix X. This is a helper for the test to check that the input
    matrix X is not mutated.
    c                 C   s   |d d …df S )Nr   r   )Úselfr2   r   r   r   r5     s    zCustomKernel.diagN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r5   r   r   r   r   rÖ     s   rÖ   c                  C   s>   t tƒ d� tt¡} t t¡}| jtdd�\}}t	t|ƒ dS )zä
    Check that the input X is not modified by the predict method of the
    GaussianProcessRegressor when setting return_std=True.

    Non-regression test for:
    https://github.com/scikit-learn/scikit-learn/issues/24340
    r)   Trr   N)
r   rÖ   r1   r2   r3   r   Úcopyri   r4   r   )r6   ZX2_copyr“   r   r   r   Ú#test_gpr_predict_input_not_modified  s    
rÝ   )MrÛ   r¶   r-   rª   Únumpyr   Zscipy.optimizer   r/   Zsklearn.gaussian_processr   Z sklearn.gaussian_process.kernelsr   r   r<   r   r   r   Z4sklearn.gaussian_process.tests._mini_sequence_kernelr	   Zsklearn.exceptionsr
   Zsklearn.utils._testingr   r   r   r   r   Z
atleast_2drœ   r2   ri   rB   r3   r#   r�   Znon_fixed_kernelsÚmarkZparametrizer9   rE   rK   rM   rT   r[   r`   rd   rh   rm   rp   rQ   rR   rS   rv   r}   rŽ   r”   r˜   rž   r¢   r­   r°   r²   r¼   r½   rÀ   rÃ   ZzerosrÈ   r‰   rÇ   rÊ   rÌ   rÔ   rÕ   rÖ   rÝ   r   r   r   r   Ú<module>   s¼   
ÿÿù




	




"
'7.

M
(-ýþúúþ
		&.