Hello @EugeneNdiaye
I tried to use clf.score(X, y) on your classifier but it breaks.
I think it's because your estimator take multiple values of lambdas as input, so when it predicts it gives predictions for several lambdas/betas while sklearn expect only one y_pred to compare to y_true.
MCVE:
import numpy as np
from numpy.linalg import norm
from smoothconco.smoothed_concomitant import SCRegressor
X = np.random.randn(10, 10)
y = X @ np.random.randn(10)
X /= norm(X, axis=0)
n_samples, n_features = X.shape
alpha_max_conco = norm(X.T @ y, ord=np.inf) / \
(norm(y) * np.sqrt(len(y)))
alphas = alpha_max_conco * np.geomspace(1, 0.1, num=10)
clf = SCRegressor(lambdas=alphas)
clf.fit(X, y)
print(clf.score(X, y))
ValueError: y_true and y_pred have different number of output (1!=100)
Let me know if I can help. @agramfort this may also be of interest to you.
Hello @EugeneNdiaye I tried to use clf.score(X, y) on your classifier but it breaks. I think it's because your estimator take multiple values of
lambdas
as input, so when it predicts it gives predictions for several lambdas/betas while sklearn expect only one y_pred to compare to y_true.MCVE:
ValueError: y_true and y_pred have different number of output (1!=100)
Let me know if I can help. @agramfort this may also be of interest to you.