成對相關

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 相關矩陣(標記重複)

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")

遮罩的體重與身高相關

Python 的降維

視覺化相關矩陣

ansur 精選相關矩陣

Python 的降維

一起來練習吧!

Python 的降維

Preparing Video For Download...