o
    tBh                     @   s   d dl 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 d dlmZ d dlmZ edd d	\ZZeeZeeZeeegjZd
d Zdd Zdd Zdd Zdd Zdd Zdd Zdd Z dS )    N)make_regression)Ridge)KernelRidge)pairwise_kernels)ignore_warnings)assert_array_almost_equal
   )
n_featuresrandom_statec                  C   sB   t dddttt} tdddttt}t| | d S N   Falphafit_interceptlinearkernelr   )r   fitXypredictr   r   predpred2 r   v/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/sklearn/tests/test_kernel_ridge.pytest_kernel_ridge   s   r   c                  C   D   t ddddttt} tdddttt}t| | d S Nr   Fcholesky)r   r   solverr   r   )r   r   Xcsrr   r   r   r   r   r   r   r   test_kernel_ridge_csr      r"   c                  C   r   r   )r   r   Xcscr   r   r   r   r   r   r   r   test_kernel_ridge_csc#   r#   r%   c                  C   sN   t dddttt} tddd}t|jtt |t}t| | d S )Nr   Fr   r   r   )r   r   r   r   r   r   r   r   )r   krr   r   r   r   !test_kernel_ridge_singular_kernel-   s
   
r'   c                  C   sV   dD ]&} t tt| d}t| dttt}tdd|t|}t|| qd S )N)r   rbfpolycosine)metricr   precomputed)r   r   r   r   r   r   r   )r   Kr   r   r   r   r   test_kernel_ridge_precomputed7   s   r/   c                  C   s6   t ttj} |  }tdd| t t| | d S )Nr-   r,   )	npdotr   Tcopyr   r   r   r   )r.   K2r   r   r   .test_kernel_ridge_precomputed_kernel_unchanged?   s   r5   c                  C   s   t ttj} t jdtjd }tdddj	tt
|dt}tdddj	tt
|dt}tdddj	| t
|d| }t|| t|| d S )	Nr   r   Fr   )sample_weightr   r   r-   )r0   r1   r   r2   randomRandomStaterandshaper   r   r   r   r   r   )r.   swr   r   pred3r   r   r    test_kernel_ridge_sample_weightsF   s   

r=   c                  C   sv   t dddttt} tdddttt}t| | tdddttt}t	||gj
}t|| d S r   )r   r   r   Yr   r   r   r   r0   arrayr2   )r   r   r<   r   r   r   test_kernel_ridge_multi_outputU   s   
r@   )!numpyr0   scipy.sparsesparsespsklearn.datasetsr   sklearn.linear_modelr   sklearn.kernel_ridger   sklearn.metrics.pairwiser   sklearn.utils._testingr   r   r   r   
csr_matrixr!   
csc_matrixr$   r?   r2   r>   r   r"   r%   r'   r/   r5   r=   r@   r   r   r   r   <module>   s(    




