【问题标题】:Does it make sense? If yes then how to handle in MSE?是否有意义?如果是,那么如何在 MSE 中处理?
【发布时间】:2021-02-25 12:27:42
【问题描述】:

对于线性回归,我们可以对一个变量进行 log 转换并将 sqrt 转换为另一个变量吗?如果是,那么在 MSE 期间该怎么办?我应该对 y_test 和预测进行 exp 还是平方?

boston['medv_log'] = np.log(boston.medv)
boston['lstat_sqrt'] = np.sqrt(boston.lstat)
x = boston.lstat_sqrt
y = boston.medv_log

【问题讨论】:

    标签: python scikit-learn data-science linear-regression data-analysis


    【解决方案1】:

    如果您在训练集和测试集中转换变量,则无需关心评估指标。如果您转换目标变量(例如使用log 函数),您需要转换您的预测(使用exp 函数)以获得实际值。

    【讨论】:

      猜你喜欢
      • 2015-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-29
      • 1970-01-01
      • 2011-02-19
      • 2018-02-24
      相关资源
      最近更新 更多