未定义的meterricwarning。我无法得到答案

发布于 2025-02-06 05:38:46 字数 545 浏览 0 评论 0原文

在我的代码中,我通过编写以下命令来计算我的多标签数据集的F1得分:

f1_score_results.append(f1_score(y_train[col], y_pred_train[col_idx], average='macro'))

此代码为我提供了输出,但错误也会出现。

“

我还写了以下代码,

print(len(np.unique(X_train)))
print(len(np.unique(X_test)))
print(len(np.unique(y_train)))
print(len(np.unique(y_test)))

即im fer IS的输出是:

“

请帮助我如何解决此问题。

In my code i'm calculating f1-score for my multi-labelled dataset by writing the following command:

f1_score_results.append(f1_score(y_train[col], y_pred_train[col_idx], average='macro'))

This code is giving me the output but error is also coming which is given below.

1

I also wrote the following code

print(len(np.unique(X_train)))
print(len(np.unique(X_test)))
print(len(np.unique(y_train)))
print(len(np.unique(y_test)))

The output that i m getting is :

2

Kindly help me how I can resolve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好倦 2025-02-13 05:38:46

发生错误,因为您缺乏测试数据。因此,警告说,我没有足够的测试数据。因此,我不能给您F-Score,所以我只能放置0.0个价值,因为我也没有任何campare。
您应该做的是尝试增加Y__TRAIN和Y__TEST数据集大小。可能施加更少的条件

The error happens, because you have a lack of testing data. Therefore the warning, saying hey i dont have enough test data. So i cant give you the f-score, so i am just gonna put a 0.0 value since i dont have anything to campare too.
What you should do is try to increase, your y_train and y_test dataset size. Maybe imposing less conditions on then

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文