首页 > 解决方案 > 我应该记录转换我的模型以进行线性回归分析吗

问题描述

我有一个波士顿房屋数据集,具有以下特征

<class 'pandas.core.frame.DataFrame'>
Int64Index: 414 entries, 1 to 414
Data columns (total 6 columns):
 #   Column                                  Non-Null Count  Dtype  
---  ------                                  --------------  -----  
 0   X2 house age                            414 non-null    float64
 1   X3 distance to the nearest MRT station  414 non-null    float64
 2   X4 number of convenience stores         414 non-null    int64  
 3   X5 latitude                             414 non-null    float64
 4   X6 longitude                            414 non-null    float64
 5   Y house price of unit area              414 non-null    float64
dtypes: float64(5), int64(1)

标准差为:

X2 house age                                11.392485
X3 distance to the nearest MRT station    1262.109595
X4 number of convenience stores              2.945562
X5 latitude                                  0.012410
X6 longitude                                 0.015347
Y house price of unit area                  13.606488
dtype: float64

我试图计算价格的偏差并得到 0.599 的值

我记录转换数据并得到 -0.7064 的值

我遇到的问题是,我应该继续使用数据集日志转换还是不需要转换它,我什么时候应该在我的数据分析中考虑日志转换?

标签: pandasdata-sciencelinear-regression

解决方案


是否使用对数转换完全取决于什么更适合您的数据。只需计算模型的性能(对数转换和非对数转换),看看哪个具有最佳性能指标。


推荐阅读