You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
SHAP returns TypeError: X matrix must have at least a column this is likely because none of the features are deemed important enough, so a 0 column input is passed to LR.
Steps/Code to reproduce bug
from cuml.explainer import KernelExplainer
from cuml.datasets import make_regression
from cuml import Lasso
X, y = make_regression(n_samples=100, n_features=10)
clf = Lasso()
clf.fit(X,y)
exp = KernelExplainer(model=clf.predict, data=X, nsamples=10)
exp.shap_values(X)
Error
/opt/conda/envs/rapids/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:615: ConvergenceWarning: Regressors in active set degenerate. Dropping a regressor, after 2 iterations, i.e. alpha=5.722e-07, with an active set of 2 regressors, and the smallest cholesky pivot element being 2.220e-16. Reduce max_iter or increase eps parameters.
warnings.warn('Regressors in active set degenerate. '
/opt/conda/envs/rapids/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:615: ConvergenceWarning: Regressors in active set degenerate. Dropping a regressor, after 3 iterations, i.e. alpha=2.861e-07, with an active set of 3 regressors, and the smallest cholesky pivot element being 2.220e-16. Reduce max_iter or increase eps parameters.
warnings.warn('Regressors in active set degenerate. '
/opt/conda/envs/rapids/lib/python3.8/site-packages/cuml/internals/api_decorators.py:409: UserWarning: Changing solver from 'eig' to 'svd' as eig solver does not support training data with 1 column currently.
return func(*args, **kwargs)
/opt/conda/envs/rapids/lib/python3.8/site-packages/cuml/internals/api_decorators.py:409: UserWarning: Changing solver from 'eig' to 'svd' as eig solver does not support training data with 1 column currently.
return func(*args, **kwargs)
/opt/conda/envs/rapids/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:642: ConvergenceWarning: Early stopping the lars path, as the residues are small and the current value of alpha is no longer well controlled. 4 iterations, alpha=4.860e-02, previous alpha=4.334e-02, with an active set of 5 regressors.
warnings.warn('Early stopping the lars path, as the residues '
/opt/conda/envs/rapids/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:615: ConvergenceWarning: Regressors in active set degenerate. Dropping a regressor, after 7 iterations, i.e. alpha=1.619e-07, with an active set of 7 regressors, and the smallest cholesky pivot element being 2.220e-16. Reduce max_iter or increase eps parameters.
warnings.warn('Regressors in active set degenerate. '
/opt/conda/envs/rapids/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py:615: ConvergenceWarning: Regressors in active set degenerate. Dropping a regressor, after 7 iterations, i.e. alpha=1.245e-07, with an active set of 7 regressors, and the smallest cholesky pivot element being 2.220e-16. Reduce max_iter or increase eps parameters.
warnings.warn('Regressors in active set degenerate. '
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-b6cdbd890780> in <module>
8
9 exp = KernelExplainer(model=clf.predict, data=X, nsamples=10)
---> 10 exp.shap_values(X)
cuml/explainer/kernel_shap.pyx in cuml.explainer.kernel_shap.KernelExplainer.shap_values()
cuml/explainer/base.pyx in cuml.explainer.base.SHAPBase._explain()
cuml/explainer/kernel_shap.pyx in cuml.explainer.kernel_shap.KernelExplainer._explain_single_observation()
cuml/explainer/kernel_shap.pyx in cuml.explainer.kernel_shap._weighted_linear_regression()
/opt/conda/envs/rapids/lib/python3.8/site-packages/cuml/internals/api_decorators.py in inner_with_setters(*args, **kwargs)
407 target_val=target_val)
408
--> 409 return func(*args, **kwargs)
410
411 @wraps(func)
cuml/linear_model/linear_regression.pyx in cuml.linear_model.linear_regression.LinearRegression.fit()
TypeError: X matrix must have at least a column
Expected behavior
It should either select at least one column or return a more descriptive error for the user. @dantegd What are you thoughts?
Environment details (please complete the following information):
docker 21.10 nightly
The text was updated successfully, but these errors were encountered:
Describe the bug
SHAP returns
TypeError: X matrix must have at least a column
this is likely because none of the features are deemed important enough, so a 0 column input is passed to LR.Steps/Code to reproduce bug
Error
Expected behavior
It should either select at least one column or return a more descriptive error for the user. @dantegd What are you thoughts?
Environment details (please complete the following information):
docker 21.10 nightly
The text was updated successfully, but these errors were encountered: