Corrélations

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

###############
# A remplacer.
try:
    import papierstat
except ImportError:
    import sys
    sys.path.append("../../../src")
    import papierstat

Récupération des données

from papierstat.datasets import load_wines_dataset
df = load_wines_dataset()
print(df.head(n=2).T)

Out:

                           0       1
fixed_acidity            7.4     7.8
volatile_acidity         0.7    0.88
citric_acid                0       0
residual_sugar           1.9     2.6
chlorides              0.076   0.098
free_sulfur_dioxide       11      25
total_sulfur_dioxide      34      67
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.

from seaborn import clustermap

clustermap(df.corr(), center=0, cmap="vlag", linewidths=.75, figsize=(4, 4))

import matplotlib.pyplot as plt
# plt.show()
../../_images/sphx_glr_plot_correlations_001.png

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

Gallery generated by Sphinx-Gallery