o
    ?Hh                     @   s  d dl Zd dlZd dlmZmZmZmZ dd Zdd Z	ej
ddd	d
ddddddeddfdeddfdeddfdeddfde	ddfde	ddfde	ddfde	ddfgdd Zej
dedddddfeddd ddfed dddd fg d!d"d#fgd$d% Zej
d&d'd(d)d*d+id'd(d+d,fd'd-d.d/d+d0d/d+d.fd1d2d3d4d5d6id1d2d6d4fi i i fi d+d/d7d8d(d9d'dd:d+d/d7d8d(d9d'dd;fgd<d= Zej
d>i d(d?d@fi dAd'dBfgdCdD ZdEdF ZdS )G    N)_despine_interval_max_min_ratio_validate_score_name_validate_style_kwargsc                   C      d S N r   r   r   a/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/sklearn/utils/tests/test_plotting.pymetric      r
   c                   C   r   r   r   r   r   r   r	   
neg_metric   r   r   z6score_name, scoring, negate_score, expected_score_name)accuracyNFr   )Nr   FAccuracy)Nr   TzNegative accuracy)Nneg_mean_absolute_errorFzNegative mean absolute error)Nr   TzMean absolute error)MAEr   Tr   )NNFScore)NNTzNegative scorezSome metricFTMetriczNegative metricc                 C   s   t | |||ks
J dS )z*Check that we return the right score name.N)r   )
score_namescoringnegate_scoreexpected_score_namer   r   r	   test_validate_score_name   s   r   zdata, lower_bound, upper_boundg?         
         g?g?)r      r   r      2   r   (   c                 C   s$   |t |   k r|k sJ  J d S r   )r   )datalower_boundupper_boundr   r   r	   test_inverval_max_min_ratio4   s   $r%   z%default_kwargs, user_kwargs, expectedbluer   )color	linewidth	linestyledashed)r'   r(   r)   solid)r'   r)   red)clsxxxkz--)labelr'   r)   r.   z-.blackyellowgreen)r.   r-   ecfclwmecmfcaltms)r)   r'   	edgecolor	facecolorr(   markeredgecolormarkerfacecoloralt
markersizec                 C   s,   t | |}||ksJ d| d| ddS )zLCheck the behaviour of `validate_style_kwargs` with various type of entries.zLThe validation of style keywords does not provide the expected results: Got z instead of .N)r   )default_kwargsuser_kwargsexpectedresultr   r   r	   test_validate_style_kwargsG   s   
.
rE   zdefault_kwargs, user_kwargs   )r.   r)   r)r-   r'   c                 C   s:   t t t| | W d   dS 1 sw   Y  dS )z3Check that `validate_style_kwargs` raises TypeErrorN)pytestraises	TypeErrorr   )rA   rB   r   r   r	    test_validate_style_kwargs_error|   s   "rK   c                 C   sl   |   }t| |jd  du sJ |jd  du sJ |jd  dks)J |jd  dks4J d S )NtopFrightbottom)r   r   left)gcar   spinesget_visible
get_bounds)pyplotaxr   r   r	   test_despine   s   rV   )numpynprH   sklearn.utils._plottingr   r   r   r   r
   r   markparametrizer   	geomspacelinspacer%   rE   rK   rV   r   r   r   r	   <module>   s    













,	
