Closed cconw closed 1 year ago
The error typically points to duplicate values in the index, which you can remove by sth like df=df[~df.index.duplicated]
.
Received the same error and removing duplicated index did not work. Tried lasso_scores2 = lasso_scores.reset_index()
and using
ax = sns.lineplot(x='alpha',
y='ic', data=lasso_scores2,
estimator=np.mean, label='Mean', ax=axes[0])
worked. Still have no idea why the error occurred for lasso_scores but not ridge_scores.
Just encountered the same problem. Your reindex method works well. But after careful inspection, I find the 'ic' column have NaN values that possibly the reason of the ValueError, I tried running: \
ax = sns.lineplot(x='alpha`, y='ic', data=lasso_scores.dropna(), estimator=np.mean, label='Mean', ax=axes[0])
and it works well.
I've been at this for a few hours trying to debug myself and understand this error and I simply cannot figure it out. It's equally perplexing to me because the ridge_scores visualization has a virtually identical call to seaborn earlier in the script and that works. If anyone has any ideas, I would appreciate it!
this specific line:
is generating this error: