<jupyter_start><jupyter_text>The penguins datasetsIn this notebook, we make a quick presentation of the[Palmer penguins dataset](https://allisonhorst.github.io/palmerpenguins/)dataset. We use this dataset for both classification and regressionproblems by selecting a subset of the features to make our explanationsintuitive. Classification datasetWe will use this dataset in classification setting to predict the penguins'species from anatomical information.Each penguin is from one of the three following species: Adelie, Gentoo, andChinstrap. See the illustration below depicting the three different penguinspecies:![Image of penguins](https://github.com/allisonhorst/palmerpenguins/raw/master/man/figures/lter_penguins.png)This problem is a classification problem since the target is categorical.We will limit our input data to a subset of the original featuresto simplify our explanations when presenting the decision tree algorithm.Indeed, we will use features based on penguins' culmen measurement. You canlearn more about the penguins' culmen with the illustration below:![Image of culmen](https://github.com/allisonhorst/palmerpenguins/raw/master/man/figures/culmen_depth.png)We will start by loading this subset of the dataset.<jupyter_code>import pandas as pd

penguins = pd.read_csv("../datasets/penguins_classification.csv")

culmen_columns = ["Culmen Length (mm)", "Culmen Depth (mm)"]
target_column = "Species"<jupyter_output><empty_output><jupyter_text>Let's check the dataset more into details.<jupyter_code>penguins.head()<jupyter_output><empty_output><jupyter_text>Since that we have few samples, we can check a scatter plot to observe thesamples distribution.<jupyter_code>import seaborn as sns

pairplot_figure = sns.pairplot(penguins, hue="Species")
pairplot_figure.fig.set_size_inches(9, 6.5)<jupyter_output><empty_output><jupyter_text>First let's check the feature distributions by looking at the diagonal plotsof the pairplot. We can deduce the following intuitions:* The Adelie species can be differentiated from the Gentoo and Chinstrap  species depending on the culmen length;* The Gentoo species can be differentiated from the Adelie and Chinstrap  species depending on the culmen depth. Regression datasetIn a regression setting, the target is a continuous variable instead ofcategories. Here, we use two features of the dataset to make such a problem:the flipper length will be used as data and the body mass will be the target.In short, we want to predict the body mass using the flipper length.We will load the dataset and visualize the relationship between the flipperlength and the body mass of penguins.<jupyter_code>penguins = pd.read_csv("../datasets/penguins_regression.csv")

data_columns = ["Flipper Length (mm)"]
target_column = "Body Mass (g)"
_ = sns.scatterplot(data=penguins, x=data_columns[0], y=target_column)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06687456687456687, 'fraction_numerical': 0.001386001386001386, 'mean_word_length': 6.402564102564103, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '86053', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 822, 'n_tokens_neox': 783, 'n_words': 313, 'path': 'notebooks/trees_dataset.ipynb', 'repo_name': 'marcobonifacio/scikit-learn-mooc', 'size': '2886'}