移除冗余特征

Python 中的机器学习预处理

James Chapman

Curriculum Manager, DataCamp

冗余特征

  • 移除噪声特征
  • 移除相关特征
  • 移除重复特征
Python 中的机器学习预处理

手动移除的情形

city state lat long
hico tx 31.982778 -98.033333
mackinaw city mi 45.783889 -84.727778
winchester ky 37.990000 -84.179722
Python 中的机器学习预处理

相关特征

  • 统计相关:特征同向变化
  • 线性模型假设特征独立
  • 皮尔逊相关系数
Python 中的机器学习预处理

相关特征

print(df)
        A     B     C
0    3.06  3.92  1.04
1    2.76  3.40  1.05
2    3.24  3.17  1.03
...
print(df.corr())
          A         B         C
A  1.000000  0.787194  0.543479
B  0.787194  1.000000  0.565468
C  0.543479  0.565468  1.000000
Python 中的机器学习预处理

让我们来练习!

Python 中的机器学习预处理

Preparing Video For Download...