如何解释MANE_TEST_SCORE和STD_TEST_SCORE?

发布于 2025-02-06 07:10:05 字数 1582 浏览 0 评论 0原文

我正在尝试使用具有分数=“ R2”的GridSearchCV来调整角rregressor模型的Hyperparams。 代码

    means = gs.cv_results_['mean_test_score']
    stds = gs.cv_results_['std_test_score']
    params = gs.cv_results_['params']
    for mean, stdev, param in zip(means, stds, params):
        print("Summary: %f (%f) with: %r" % (mean, stdev, param))

输出以下结果。我担心R2是如此不同。特别是负面因素,意味着该模型的性能差。 这是否意味着存在潜在的问题?

Summary: -0.005585 (0.234004) with: {'batch_size': 5,}
Summary: 0.849829 (0.023618) with: {'batch_size': 5, batch_size': 10, 'epochs': 100}
Summary: -0.210410 (0.131035) with: {'batch_size': 20, 'epochs': 10}
Summary: 0.294107 (0.261391) with: {'batch_size': 20, 'epochs': 50}
Summary: 0.857905 (0.006955) with: {'batch_size': 20, 'epochs': 100}
Summary: -0.381018 (0.118675) with: {'batch_size': 40, 'epochs': 10}
Summary: -0.053815 (0.321491) with: {'batch_size': 40, 'epochs': 50}
Summary: 0.582999 (0.195620) with: {'batch_size': 40, 'epochs': 100}
Summary: -0.413765 (0.114058) with: {'batch_size': 60, 'epochs': 10}
Summary: -0.018707 (0.090325) with: {'batch_size': 60, 'epochs': 50}
Summary: 0.205208 (0.157954) with: {'batch_size': 60, 'epochs': 100}
Summary: -0.423384 (0.112643) with: {'batch_size': 80, 'epochs': 10}
Summary: -0.077780 (0.101668) with: {'batch_size': 80, 'epochs': 50}
Summary: -0.000941 (0.345382) with: {'batch_size': 80, 'epochs': 100}
Summary: -0.427151 (0.112105) with: {'batch_size': 100, 'epochs': 10}
Summary: -0.177046 (0.125664) with: {'batch_size': 100, 'epochs': 50}

培训数据集形状为(9073,5),测试:(477,5)

谢谢

I'm trying to tune hyperparams of the KerasRegressor model using GridSearchCV that has score = "r2" .
The code

    means = gs.cv_results_['mean_test_score']
    stds = gs.cv_results_['std_test_score']
    params = gs.cv_results_['params']
    for mean, stdev, param in zip(means, stds, params):
        print("Summary: %f (%f) with: %r" % (mean, stdev, param))

outputs the results below. I'm concerned that r2 is so different. Especially negatives that mean that model is performing poorly.
Does it mean that there is an underlying problem ?

Summary: -0.005585 (0.234004) with: {'batch_size': 5,}
Summary: 0.849829 (0.023618) with: {'batch_size': 5, batch_size': 10, 'epochs': 100}
Summary: -0.210410 (0.131035) with: {'batch_size': 20, 'epochs': 10}
Summary: 0.294107 (0.261391) with: {'batch_size': 20, 'epochs': 50}
Summary: 0.857905 (0.006955) with: {'batch_size': 20, 'epochs': 100}
Summary: -0.381018 (0.118675) with: {'batch_size': 40, 'epochs': 10}
Summary: -0.053815 (0.321491) with: {'batch_size': 40, 'epochs': 50}
Summary: 0.582999 (0.195620) with: {'batch_size': 40, 'epochs': 100}
Summary: -0.413765 (0.114058) with: {'batch_size': 60, 'epochs': 10}
Summary: -0.018707 (0.090325) with: {'batch_size': 60, 'epochs': 50}
Summary: 0.205208 (0.157954) with: {'batch_size': 60, 'epochs': 100}
Summary: -0.423384 (0.112643) with: {'batch_size': 80, 'epochs': 10}
Summary: -0.077780 (0.101668) with: {'batch_size': 80, 'epochs': 50}
Summary: -0.000941 (0.345382) with: {'batch_size': 80, 'epochs': 100}
Summary: -0.427151 (0.112105) with: {'batch_size': 100, 'epochs': 10}
Summary: -0.177046 (0.125664) with: {'batch_size': 100, 'epochs': 50}

The Training dataset shape is (9073, 5), test: (477, 5)

Thank you

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

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

发布评论

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

评论(1

还在原地等你 2025-02-13 07:10:06

R2表示在回归方程创建的行中的数据点的比例。较高的R2值是可取的,因为它表明结果更好。

您需要将最小值标准化为0,最大值为1,因为R2是线路的一部分。负数是不可能的。

由于最小值为零,因此您不能在分母中使用它,因此您必须这样设置它

,因此请使用1- [0/r1]

有一个用于修复此错误


from sklearn.metrics import r2_score

R2 indicates the proportion of data points which lie within the line created by the regression equation. A higher value of R2 is desirable as it indicates better results.

You need to standardize the minimum to 0 and the maximum to one, since r2 is a proportion of the line. A negative % is not possible.

since the minimum is zero you cant have it in the denominator, so you have to set it like this

so use 1 - [0/r1]

there is a python module for fixing this error


from sklearn.metrics import r2_score

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