两两相关性

Python 中的降维

Jeroen Boeye

Head of Machine Learning, Faktion

两两相关性

sns.pairplot(ansur, hue="gender")

ansur 成对图

Python 中的降维

两两相关性

sns.pairplot(ansur, hue="gender")

ansur 成对图(标注)

Python 中的降维

相关系数

极端相关性

Python 中的降维

相关系数

混乱的相关性

Python 中的降维

相关矩阵

weights_df.corr()

相关矩阵 ansur

Python 中的降维

相关矩阵

weights_df.corr()

相关矩阵 ansur 重复项

Python 中的降维

相关矩阵

weights_df.corr()

相关矩阵 ansur 重复项 2

Python 中的降维

相关矩阵

weights_df.corr()

相关矩阵 ansur 对角线

Python 中的降维

相关矩阵可视化

cmap = sns.diverging_palette(h_neg=10, 
                             h_pos=240, 
                             as_cmap=True)

sns.heatmap(weights_df.corr(), center=0, 
            cmap=cmap, linewidths=1, 
            annot=True, fmt=".2f")

相关矩阵可视化

Python 中的降维

相关矩阵可视化

corr = weights_df.corr()

mask = np.triu(np.ones_like(corr, dtype=bool))
array([[ True,  True,  True],
       [False,  True,  True],
       [False, False,  True]])
Python 中的降维

相关矩阵可视化

sns.heatmap(weights_df.corr(), mask=mask, 
            center=0, cmap=cmap, linewidths=1, 
            annot=True, fmt=".2f")

体重 vs 身高 相关性(遮罩)

Python 中的降维

相关矩阵可视化

ansur 相关矩阵(筛选)

Python 中的降维

Vamos praticar!

Python 中的降维

Preparing Video For Download...