@@ -0,0 +1,1360 @@
+import numpy as np%0A%0Afrom sklearn.datasets import make_classification%0Afrom sklearn.linear_model import Ridge%0Afrom sklearn.kernel_ridge import KernelRidge%0A%0Afrom sklearn.utils.testing import assert_array_almost_equal%0A%0A%0AX, y = make_classification(n_classes=2, random_state=0)%0AY = np.array(%5By, y%5D).T%0A%0A%0Adef test_kernel_ridge():%0A    pred = Ridge(alpha=1, fit_intercept=False).fit(X, y).predict(X)%0A    pred2 = KernelRidge(kernel=%22linear%22, alpha=1).fit(X, y).predict(X)%0A    assert_array_almost_equal(pred, pred2)%0A%0A%0Adef test_kernel_ridge_precomputed():%0A    K = np.dot(X, X.T)%0A    pred = KernelRidge(kernel=%22linear%22).fit(X, y).predict(X)%0A    pred2 = KernelRidge(kernel=%22precomputed%22).fit(K, y).predict(K)%0A    assert_array_almost_equal(pred, pred2)%0A%0A%0Adef test_kernel_ridge_precomputed_sample_weight():%0A    K = np.dot(X, X.T)%0A    K2 = K.copy()%0A    sw = np.ones(X.shape%5B0%5D) / float(X.shape%5B0%5D)%0A    KernelRidge(kernel=%22precomputed%22).fit(K, y, sample_weight=sw)%0A    assert_array_almost_equal(K, K2)%0A%0A%0Adef test_kernel_ridge_multi_output():%0A    pred = Ridge(alpha=1, fit_intercept=False).fit(X, Y).predict(X)%0A    pred2 = KernelRidge(kernel=%22linear%22, alpha=1).fit(X, Y).predict(X)%0A    assert_array_almost_equal(pred, pred2)%0A%0A    pred3 = KernelRidge(kernel=%22linear%22, alpha=1).fit(X, y).predict(X)%0A    pred3 = np.array(%5Bpred3, pred3%5D).T%0A    assert_array_almost_equal(pred2, pred3)%0A

TEST Added tests for KernelRidge based on @mblondel's code in lightning