o
    xi
                     @   sf   d Z ddlmZ ddlZddlZddlmZmZ ede	d dddZ
									
	dddZdS )z4Define plots used by multiple sklearn model classes.    )simplefilterN)	calculateutilsignore)actioncategoryc           	      C   sn   t j| ||||d}t j| ||||d}t | }|r1|r3|r5t| ||||}td|i dS dS dS dS )at  Logs a chart depicting summary metrics for a model.

    Should only be called with a fitted model (otherwise an error is thrown).

    Args:
        model: (clf or reg) Takes in a fitted regressor or classifier.
        X: (arr) Training set features.
        y: (arr) Training set labels.
        X_test: (arr) Test set features.
        y_test: (arr) Test set labels.

    Returns:
        None: To see plots, go to your W&B run page then expand the 'media' tab
              under 'auto visualizations'.

    Example:
    ```python
    wandb.sklearn.plot_summary_metrics(model, X_train, y_train, X_test, y_test)
    ```
    )modelXyX_testy_testsummary_metricsN)r   test_missing
test_typestest_fittedr   r   wandblog)	r   r	   r
   r   r   not_missingcorrect_typesmodel_fittedmetrics_chart r   Y/home/ubuntu/.local/lib/python3.10/site-packages/wandb/integration/sklearn/plot/shared.pyr      s   


r   F   c	                 C   s|   t j| ||d}	t j| ||d}
|	r:|
r<|du rtddd}t|}t| ||||||||	}t	d|i dS dS dS )a  Logs a plot depicting model performance against dataset size.

    Please note this function fits the model to datasets of varying sizes when called.

    Args:
        model: (clf or reg) Takes in a fitted regressor or classifier.
        X: (arr) Dataset features.
        y: (arr) Dataset labels.

    For details on the other keyword arguments, see the documentation for
    `sklearn.model_selection.learning_curve`.

    Returns:
        None: To see plots, go to your W&B run page then expand the 'media' tab
              under 'auto visualizations'.

    Example:
    ```python
    wandb.sklearn.plot_learning_curve(model, X, y)
    ```
    )r   r	   r
   Ng?g      ?   learning_curve)
r   r   r   nplinspaceasarrayr   r   r   r   )r   r	   r
   cvshufflerandom_statetrain_sizesn_jobsscoringr   r   learning_curve_chartr   r   r   r   0   s    
r   )NNNNN)	NNNNFNNr   N)__doc__warningsr   numpyr   r   wandb.integration.sklearnr   r   FutureWarningr   r   r   r   r   r   <module>   s"    
#