This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sns.scatterplot(x="proline", y="flavanoids", hue="target", data=df, palette="Dark2", s=80) | |
| plt.title("Relazione tra proline, flavanoids e target") | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sns.catplot(x="target", y="proline", data=df, kind="box", aspect=1.5) | |
| plt.title("Boxplot per target e proline") | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sns.pairplot(df) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print(f"Curtosi: {df['magnesium'].kurt()}") | |
| print(f"Asimmetria: {df['magnesium'].skew()}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df.target.value_counts().plot(kind="bar") | |
| plt.title("Conteggio valori della variabile target") | |
| plt.xlabel("Tipo di vino") | |
| plt.xticks(rotation=0) | |
| plt.ylabel("Conteggio") | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df.rename(columns={"od280/od315_of_diluted_wines": "protein_concentration"}, inplace=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # carichiamo il dataset | |
| wine = load_wine() | |
| # convertiamo il dataset in un dataframe Pandas | |
| df = pd.DataFrame(data=wine.data, columns=wine.feature_names) | |
| # creiamo la colonna per il target | |
| df["target"] = wine.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| df = pd.read_csv("percorso/al/mio/dataset.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # manipolazione dati | |
| import pandas as pd | |
| import numpy as np | |
| # visualizzazione | |
| import matplotlib.pyplot as plt | |
| from matplotlib import rcParams | |
| import seaborn as sns | |
| # applichiamo uno stile piacevole alla vista e settiamo i parametri di visualizzazione |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sns.catplot(x="target", y="proline", data=df, kind="box", aspect=1.5) | |
| plt.title("Boxplot per target e proline") | |
| plt.show() |