在监督学习中,如何从相关性中获取信息?
数据挖掘
机器学习
Python
相关性
2022-02-13 22:37:11
1个回答
为了帮助您,它显示了特征与其他特征之间的相关性。例如,您提供的图像中的数字 1 显示在矩阵的对角线部分。这些表示与特征之一和其他特征之一的 100% 线性相关。此图像可能会有所帮助:

如您所见,负相关意味着随着一个特征值的增加,另一个特征值减小。相关性为 0 意味着特征似乎没有线性相关性。
如果您只想专注于标签和特征之间的相关性,那么这里有一些 python 代码(我假设您正在使用的语言)来帮助您:
# Your data should be a pandas core dataframe
yourdata = ...
# To find correlations, use the corr() function
corr_matrix = yourdata.corr()
corr_matrix["your label"].sort_values(ascending=False)
# This should print out a correlation list.
# If it doesn't then wrap the last line of code in print( )
# You are going to notice that some features will be missing from the list.
# That is because the corr() function does not return any discrete features.
# If you still have every feature, then every one of your features are continuous.
其它你可能感兴趣的问题
