Corrélations

Dessine les corrélations pour un jeu de données.

from seaborn import clustermap
from teachpyx.datasets import load_wines_dataset

Récupération des données

df = load_wines_dataset()
print(df.head(n=2).T)
                           0       1
fixed_acidity            7.4     7.8
volatile_acidity         0.7    0.88
citric_acid              0.0     0.0
residual_sugar           1.9     2.6
chlorides              0.076   0.098
free_sulfur_dioxide     11.0    25.0
total_sulfur_dioxide    34.0    67.0
density               0.9978  0.9968
pH                      3.51     3.2
sulphates               0.56    0.68
alcohol                  9.4     9.8
quality                    5       5
color                    red     red

Les corrélations avec seaborn.

corr = df.corr(numeric_only=True)

clustermap(corr, center=0, cmap="vlag", linewidths=0.75, figsize=(4, 4))

# plt.show()
plot correlations
<seaborn.matrix.ClusterGrid object at 0x7f165aa2c520>

Total running time of the script: (0 minutes 2.096 seconds)

Gallery generated by Sphinx-Gallery