From ba6bea2c731926b87d391ac1209f19c0fd11cf81 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Wed, 5 Nov 2025 17:09:58 +0100 Subject: [PATCH] Add new Jupyter notebooks for ResNet and CNN exercises; update execution counts in existing notebooks --- ...TP1 - Bonus Starter _ Régularisation.ipynb | 0 .../{ => TP1}/TP1 - Starter.ipynb | 0 .../TP2/TP2 - Bonus Starter _ ResNet.ipynb | 146 ++++++++++ M2/Deep Learning/TP2/TP2 - Starter.ipynb | 269 ++++++++++++++++++ .../TP_1/2025_TP_1_M2_ISF.ipynb | 4 +- .../TP_3/2025_TP_3_M2_ISF.ipynb | 124 ++++---- .../TP_4/2025_M2_ISF_TP_4.ipynb | 4 +- 7 files changed, 480 insertions(+), 67 deletions(-) rename M2/Deep Learning/{ => TP1}/TP1 - Bonus Starter _ Régularisation.ipynb (100%) rename M2/Deep Learning/{ => TP1}/TP1 - Starter.ipynb (100%) create mode 100644 M2/Deep Learning/TP2/TP2 - Bonus Starter _ ResNet.ipynb create mode 100644 M2/Deep Learning/TP2/TP2 - Starter.ipynb diff --git a/M2/Deep Learning/TP1 - Bonus Starter _ Régularisation.ipynb b/M2/Deep Learning/TP1/TP1 - Bonus Starter _ Régularisation.ipynb similarity index 100% rename from M2/Deep Learning/TP1 - Bonus Starter _ Régularisation.ipynb rename to M2/Deep Learning/TP1/TP1 - Bonus Starter _ Régularisation.ipynb diff --git a/M2/Deep Learning/TP1 - Starter.ipynb b/M2/Deep Learning/TP1/TP1 - Starter.ipynb similarity index 100% rename from M2/Deep Learning/TP1 - Starter.ipynb rename to M2/Deep Learning/TP1/TP1 - Starter.ipynb diff --git a/M2/Deep Learning/TP2/TP2 - Bonus Starter _ ResNet.ipynb b/M2/Deep Learning/TP2/TP2 - Bonus Starter _ ResNet.ipynb new file mode 100644 index 0000000..8a385bf --- /dev/null +++ b/M2/Deep Learning/TP2/TP2 - Bonus Starter _ ResNet.ipynb @@ -0,0 +1,146 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Séance 2 - Bonus : ResNet à la main\n", + "\n", + "Pour poursuivre le travail du TP, on se propose d'explorer une autre manière de définir un réseau de neurones au travers d'une architecture classique de Deep Learning pour la vision : les ResNet. \n", + "\n", + "Commençons par importer et traiter les données." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "%matplotlib inline\n", + "import matplotlib.pyplot as plt\n", + "import seaborn as sns; sns.set(style='whitegrid')\n", + "\n", + "import tensorflow as tf\n", + "from tensorflow import keras\n", + "\n", + "from sklearn.preprocessing import StandardScaler\n", + "from sklearn.model_selection import train_test_split\n", + "\n", + "(X_train_full, y_train_full), (X_test, y_test) = (keras.datasets.fashion_mnist.load_data())\n", + "X_train, X_valid, y_train, y_valid = train_test_split(X_train_full, y_train_full, train_size=0.8)\n", + "\n", + "scaler = StandardScaler()\n", + "X_train = scaler.fit_transform(X_train.astype(np.float32).reshape(-1, 28 * 28)).reshape(-1, 28, 28, 1)\n", + "X_valid = scaler.transform(X_valid.astype(np.float32).reshape(-1, 28 * 28)).reshape(-1, 28, 28, 1)\n", + "X_test = scaler.transform(X_test.astype(np.float32).reshape(-1, 28 * 28)).reshape(-1, 28, 28, 1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pour rappel, une architecture ResNet correspond à la succession de ResBlock qui, dans le papier d'origine, ont l'architecture suivante :\n", + "1. Une couche de convolution avec padding pour conserver la taille de l'image\n", + "2. Une couche de BatchNormalization, que l'on explicitera en cours à la séance prochaine\n", + "3. L'activation ReLU, qui ne doit donc pas être présente dans la couche de convolution\n", + "4. Une couche de convolution avec padding pour conserver la taille de l'image\n", + "5. Une couche de BatchNormalization\n", + "6. Un ajout de l'input avant le point 1 et du résultat de la dernière couche de BatchNormalization (point 5)\n", + "7. L'activation ReLU sur l'ajout\n", + "\n", + "On ne peut pas définir cette architecture si l'on utilise la méthode d'instanciation que l'on a utilisé jusqu'ici. Pour y arriver, nous avons besoin d'utiliser la version *fonctionnelle* de Keras. Par exemple avec un modèle dense :" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "input = keras.layers.Input(shape=X_train.shape[1:])\n", + "flatten = keras.layers.Flatten()(input)\n", + "dense_1 = keras.layers.Dense(units=64, activation=\"relu\")(flatten)\n", + "dense_2 = keras.layers.Dense(units=64)(dense_1)\n", + "activation = keras.layers.ReLU()(dense_2)\n", + "output = keras.layers.Dense(units=10, activation=\"softmax\")(activation)\n", + "\n", + "model = keras.models.Model(inputs=[input], outputs=[output])\n", + "model.summary()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : En utilisant la version fonctionnelle de Keras, définir une fonction `ResidualBlock` qui prend en paramètre un argument *input* qui correspondra à une couche Keras et en second argument des *kwargs* à passer aux différentes couches de convolutions." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Définir un modèle utilisant deux ResBlock pour résoudre le problème de classification auquel on s'intéresse." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Après avoir compilé le modèle, lancer l'entraînement sur quelque époque pour vérifier qu'il fonctionne." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pour aller plus loin, on pourrait se demander s'il est nécessaire de réaliser ces connexions résiduelles. Pour y répondre, on conseille de construire un réseau de neurones convolutionnel *classique* et comparer les performances pour plusieurs entraînement." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/M2/Deep Learning/TP2/TP2 - Starter.ipynb b/M2/Deep Learning/TP2/TP2 - Starter.ipynb new file mode 100644 index 0000000..7b5668a --- /dev/null +++ b/M2/Deep Learning/TP2/TP2 - Starter.ipynb @@ -0,0 +1,269 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Séance 2 - Réseau de neurones convolutionnel\n", + "\n", + "On se propose de classifier les chiffres manuscrit du dataset [FashionMNIST](https://github.com/zalandoresearch/fashion-mnist) en définissant ses propres réseaux de neurones convolutionnel. L'objectif est de découvrir la manière d'entraîner ces algorithmes et observer en pratique les bases théoriques discutées en cours.\n", + "\n", + "## Exploration des données\n", + "\n", + "Commençons par importer les données." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "%matplotlib inline\n", + "import matplotlib.pyplot as plt\n", + "import seaborn as sns; sns.set(style='whitegrid')\n", + "\n", + "import tensorflow as tf\n", + "from tensorflow import keras\n", + "\n", + "(X_train_full, y_train_full), (X_test, y_test) = (keras.datasets.fashion_mnist.load_data())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : À l'aide de la fonction [`train_test_split`](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html), séparer le jeu d'entraînement complet en un dataset d'entraînement et un dataset de validation. Afficher les tailles des datasets respectifs." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Les classes sont encore des nombres, mais ils correspondent à une catégorie. Pour mieux visualiser, nous allons faire un dictionnaire." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "label_map = {0: \"t-shirt/top\", 1: \"trouser\", 2: \"pullover\",\n", + " 3: \"dress\", 4: \"coat\", 5: \"sandal\",\n", + " 6: \"shirt\", 7: \"sneaker\", 8: \"bag\", 9: \"ankle boot\"}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Afficher plusieurs images du dataset d'entraînement aléatoirement. On pourra utiliser la fonction [`imshow`](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html) et le dictionnaire." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Standardiser les données en utilisant la classe [`StandardScaler`](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html). On commencera par applatir les images en utilisant la méthode [`reshape`](https://numpy.org/doc/stable/reference/generated/numpy.reshape.html), puis on applique le pré-processing et on termine par reformer la matrice." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Modélisation\n", + "\n", + "On veut définir le réseau suivant:\n", + "* Deux convolutions avec 32 filtres 3x3 en conservant la taille. On utilisera la couche [`Conv2D`](https://keras.io/api/layers/convolution_layers/convolution2d/)\n", + "* Une couche max pooling avec un filtre 2x2 et 2 de stride. On utilisera la couche [`MaxPool2D`](https://keras.io/api/layers/pooling_layers/max_pooling2d/)\n", + "* Une couche [`Flatten`](https://keras.io/api/layers/reshaping_layers/flatten/) puis un réseau dense de 64 neurones\n", + "* Une couche de sortie à 10 neurones\n", + "\n", + "**Consigne** : Définir le réseau souhaité. On sélectionnera la fonction d'activation et la distribution initiale des poids adaptées." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Calculer le nombre de paramètre du réseau de neurones à la main, puis vérifier avec la méthode [`summary`](https://keras.io/api/models/model/#summary-method)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Lancer l'entraînement avec les paramètres adaptés sur quelques époque pour vérifier son fonctionnement." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Couche BatchNormalization\n", + "\n", + "On souhaite mesurer l'apport de la couche [`BatchNormalization`](https://keras.io/api/layers/normalization_layers/batch_normalization/) à un réseau de neurone. Pour cela, on se propose de faire une étude comparative sur le modèle que nous venons de définir. Nous nous proposons de placer la couche BatchNormalization uniquement entre les deux couches de convolution.\n", + "\n", + "**Consigne** : Définir une fonction `get_model` qui prend en paramètre:\n", + "* *normalization*: un booléen indiquant si la couche [`BatchNormalization`](https://keras.io/api/layers/normalization_layers/batch_normalization/) doit être présente dans le modèle\n", + "* *learning_rate*: un flottant correspondant au learning rate souhaité\n", + "\n", + "La fonction renvoie un modèle compilé." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Combien de paramètre un modèle avec la couche de [`BatchNormalization`](https://keras.io/api/layers/normalization_layers/batch_normalization/) a-t-il ? Est-ce équivalent à un modèle sans [`BatchNormalization`](https://keras.io/api/layers/normalization_layers/batch_normalization/) ? " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pour s'affranchir un peu de l'aléatoire, nous proposons de lancer trois fois les deux types de modèles pour les comparer.\n", + "\n", + "**Consigne** : Écrire une boucle d'entraînement qui va stocker dans une liste les courbes d'apprentissage. Chaque élément de la liste correspondra à un dictionnaire avec pour clé:\n", + "* *type*: le type du réseau (avec ou sans BatchNormalization)\n", + "* *history*: l'historique d'apprentissage" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Il faut maintenant visualiser les résultats. Commençons par préparer les données.\n", + "\n", + "**Consigne** : Définir une fonction `agregate_result` qui prend en paramètre:\n", + "* *results*: le dictionnaire de résultat, au format décrit précédemment\n", + "* *network_type*: chaîne de caractère identifiant le type de réseau\n", + "* *metric_name*: le nom de la métrique d'intérêt\n", + "\n", + "La fonction renverra deux matrices de tailles (nombre de comparaisons, nombre d'époque) : une pour le dataset d'entraînement et une pour le dataset de validation. On concatène donc les différentes courbes d'apprentissage." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Visualiser les courbes d'apprentissage en faisant apparaître des intervals de confiance. On prendra exemple sur la fonction `show_results` du TP précédent. Commenter." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Pour continuer\n", + "\n", + "Choisir une ou plusieurs pistes de recherche parmi les suivantes. Il est possible de choisir une autre direction, mais elle doit être validé auparavant.\n", + "\n", + "1. Nous avons utilisé la couche [`MaxPool2D`](https://keras.io/api/layers/pooling_layers/max_pooling2d/), mais on peut se poser la question de l'utilisation de la couche [`AveragePooling2D`](https://keras.io/api/layers/pooling_layers/average_pooling2d/) voire l'absence de couche de pooling.\n", + "2. Nous avons vu en cours qu'une agencement particulier de couches permet d'avoir les meilleurs performance pour la compétition ImageNet: les ResNet. Comment écrire un réseau résiduel à la main ?\n", + "3. Dans un [billet de blog](https://www.rpisoni.dev/posts/cossim-convolution/) est proposée une alternative à la couche convolutionnelle traditionnelle. On se propose de l'implémenter et d'explorer ses capacités." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/M2/Machine Learning/TP_1/2025_TP_1_M2_ISF.ipynb b/M2/Machine Learning/TP_1/2025_TP_1_M2_ISF.ipynb index da2a282..cc5401f 100644 --- a/M2/Machine Learning/TP_1/2025_TP_1_M2_ISF.ipynb +++ b/M2/Machine Learning/TP_1/2025_TP_1_M2_ISF.ipynb @@ -18662,7 +18662,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "id": "bb7eaef1", "metadata": {}, "outputs": [ @@ -33771,7 +33771,7 @@ "source": [ "fig = px.histogram(data_set, x=\"FREQUENCE_PAIEMENT_COTISATION\")\n", "\n", - "fig.show()\n" + "fig.show()" ] }, { diff --git a/M2/Machine Learning/TP_3/2025_TP_3_M2_ISF.ipynb b/M2/Machine Learning/TP_3/2025_TP_3_M2_ISF.ipynb index a3d72a0..81a86bf 100644 --- a/M2/Machine Learning/TP_3/2025_TP_3_M2_ISF.ipynb +++ b/M2/Machine Learning/TP_3/2025_TP_3_M2_ISF.ipynb @@ -46,7 +46,7 @@ }, { "cell_type": "code", - "execution_count": 191, + "execution_count": 1, "id": "97d58527", "metadata": {}, "outputs": [], @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 192, + "execution_count": 2, "id": "c67db932", "metadata": {}, "outputs": [], @@ -111,7 +111,7 @@ }, { "cell_type": "code", - "execution_count": 193, + "execution_count": 3, "id": "c9597b48", "metadata": {}, "outputs": [], @@ -130,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 194, + "execution_count": 4, "id": "8051b5f4", "metadata": {}, "outputs": [], @@ -174,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 195, + "execution_count": 5, "id": "c427a4b8", "metadata": {}, "outputs": [ @@ -182,14 +182,12 @@ "name": "stderr", "output_type": "stream", "text": [ - "/var/folders/tp/_ld5_pzs6nx6mv1pbjhq1l740000gn/T/ipykernel_41302/358057511.py:7: SettingWithCopyWarning:\n", - "\n", - "\n", + "/var/folders/tp/_ld5_pzs6nx6mv1pbjhq1l740000gn/T/ipykernel_79947/358057511.py:7: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame.\n", "Try using .loc[row_indexer,col_indexer] = value instead\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", - "\n" + " data_model[\"CM\"] = data_model[\"CHARGE\"] / data_model[\"NB\"]\n" ] }, { @@ -272,7 +270,7 @@ "type": "float" } ], - "ref": "9e024176-1fe1-4a76-bb33-627401a1ea24", + "ref": "a70f0dbd-403e-4585-990e-4028b5b0673d", "rows": [ [ "10", @@ -520,7 +518,7 @@ "89 [25000;35000[ 166.73 " ] }, - "execution_count": 195, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -547,7 +545,7 @@ }, { "cell_type": "code", - "execution_count": 196, + "execution_count": 6, "id": "c8fd3ee1", "metadata": {}, "outputs": [ @@ -631,7 +629,7 @@ "type": "float" } ], - "ref": "59cf3e53-3de4-4283-9dac-6a29f574b6fe", + "ref": "63d03be7-3681-4d8e-b0be-ed765b8f2594", "rows": [ [ "count", @@ -1107,7 +1105,7 @@ "max NaN 83421.850000 " ] }, - "execution_count": 196, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -1118,7 +1116,7 @@ }, { "cell_type": "code", - "execution_count": 197, + "execution_count": 7, "id": "2d32ae2b", "metadata": {}, "outputs": [ @@ -1994,7 +1992,7 @@ }, { "cell_type": "code", - "execution_count": 198, + "execution_count": 8, "id": "1b156435", "metadata": {}, "outputs": [ @@ -2004,7 +2002,7 @@ "(824, 13)" ] }, - "execution_count": 198, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -2016,7 +2014,7 @@ }, { "cell_type": "code", - "execution_count": 199, + "execution_count": 9, "id": "0ef0fcc0", "metadata": {}, "outputs": [], @@ -2052,7 +2050,7 @@ }, { "cell_type": "code", - "execution_count": 200, + "execution_count": 10, "id": "e130aae5", "metadata": {}, "outputs": [], @@ -2062,7 +2060,7 @@ }, { "cell_type": "code", - "execution_count": 201, + "execution_count": 11, "id": "c39e2ad0", "metadata": {}, "outputs": [ @@ -2121,7 +2119,7 @@ "type": "float" } ], - "ref": "2f5478f2-7cdc-47d7-aeff-3055a9f87820", + "ref": "b82309b4-707a-46f5-b3fe-c9c1324ee757", "rows": [ [ "CONTRAT_ANCIENNETE", @@ -2426,7 +2424,7 @@ "VALEUR_DU_BIEN 0.08 0.05 1.00 " ] }, - "execution_count": 201, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -2456,7 +2454,7 @@ }, { "cell_type": "code", - "execution_count": 202, + "execution_count": 44, "id": "1755a2a4", "metadata": {}, "outputs": [], @@ -2484,7 +2482,7 @@ }, { "cell_type": "code", - "execution_count": 203, + "execution_count": 13, "id": "a16215ab", "metadata": {}, "outputs": [], @@ -2494,7 +2492,7 @@ }, { "cell_type": "code", - "execution_count": 204, + "execution_count": 14, "id": "532ca6c4", "metadata": {}, "outputs": [ @@ -2528,7 +2526,7 @@ "type": "float" } ], - "ref": "cbf56bf5-5e8b-495e-a03c-dc55b1f8dfd7", + "ref": "d1b7089c-632a-4c1a-8ee0-ef265e2f24f3", "rows": [ [ "ANNEE_CTR", @@ -2636,7 +2634,7 @@ "ANNEE_CONSTRUCTION 1.000000 " ] }, - "execution_count": 204, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -2649,7 +2647,7 @@ }, { "cell_type": "code", - "execution_count": 205, + "execution_count": 15, "id": "6c3bd9b2", "metadata": {}, "outputs": [], @@ -2713,7 +2711,7 @@ }, { "cell_type": "code", - "execution_count": 206, + "execution_count": 16, "id": "b8530717", "metadata": {}, "outputs": [ @@ -2887,7 +2885,7 @@ "type": "float" } ], - "ref": "a62943ce-0b7b-4ed1-9ec2-fe8c4868e843", + "ref": "e9b7e285-2962-4a24-989a-bde4f9adf740", "rows": [ [ "0", @@ -3305,7 +3303,7 @@ "[5 rows x 32 columns]" ] }, - "execution_count": 206, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -3335,7 +3333,7 @@ }, { "cell_type": "code", - "execution_count": 207, + "execution_count": 17, "id": "4ff3847d", "metadata": {}, "outputs": [ @@ -3369,7 +3367,7 @@ "type": "float" } ], - "ref": "012814d2-2bb4-463c-b907-53ba71631da2", + "ref": "e1f3a979-59a5-4ca5-8c34-9aaf039cc275", "rows": [ [ "0", @@ -3486,7 +3484,7 @@ "4 -0.253948 -1.766941 -1.275287 -0.383438" ] }, - "execution_count": 207, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -3521,7 +3519,7 @@ }, { "cell_type": "code", - "execution_count": 208, + "execution_count": 18, "id": "6a1c7907", "metadata": {}, "outputs": [], @@ -3533,7 +3531,7 @@ }, { "cell_type": "code", - "execution_count": 209, + "execution_count": 19, "id": "58a14153", "metadata": {}, "outputs": [], @@ -3566,7 +3564,7 @@ }, { "cell_type": "code", - "execution_count": 210, + "execution_count": 20, "id": "053e013c", "metadata": {}, "outputs": [], @@ -3588,7 +3586,7 @@ }, { "cell_type": "code", - "execution_count": 211, + "execution_count": 21, "id": "c4ca2cf9", "metadata": {}, "outputs": [ @@ -3617,7 +3615,7 @@ }, { "cell_type": "code", - "execution_count": 212, + "execution_count": 22, "id": "4b739d5b", "metadata": {}, "outputs": [ @@ -3625,9 +3623,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "MAE: 5186.37\n", - "MSE: 94029342.74\n", - "RMSE: 9696.87\n" + "MAE: 5047.78\n", + "MSE: 88252585.29\n", + "RMSE: 9394.28\n" ] } ], @@ -3703,7 +3701,7 @@ }, { "cell_type": "code", - "execution_count": 213, + "execution_count": 23, "id": "ab1e1367", "metadata": {}, "outputs": [], @@ -3735,7 +3733,7 @@ }, { "cell_type": "code", - "execution_count": 214, + "execution_count": 24, "id": "b515460e", "metadata": {}, "outputs": [], @@ -3758,7 +3756,7 @@ }, { "cell_type": "code", - "execution_count": 215, + "execution_count": 25, "id": "eebb394f", "metadata": {}, "outputs": [], @@ -3786,7 +3784,7 @@ }, { "cell_type": "code", - "execution_count": 216, + "execution_count": 26, "id": "b067126c", "metadata": {}, "outputs": [ @@ -3812,7 +3810,7 @@ }, { "cell_type": "code", - "execution_count": 217, + "execution_count": 27, "id": "6597152c", "metadata": {}, "outputs": [ @@ -3836,7 +3834,7 @@ }, { "cell_type": "code", - "execution_count": 218, + "execution_count": 28, "id": "63ff1c9d", "metadata": {}, "outputs": [ @@ -3884,7 +3882,7 @@ }, { "cell_type": "code", - "execution_count": 219, + "execution_count": 29, "id": "d9342ad6", "metadata": {}, "outputs": [], @@ -3915,7 +3913,7 @@ }, { "cell_type": "code", - "execution_count": 220, + "execution_count": 30, "id": "6d58dbc2", "metadata": {}, "outputs": [], @@ -3948,7 +3946,7 @@ }, { "cell_type": "code", - "execution_count": 221, + "execution_count": 31, "id": "47da5172", "metadata": {}, "outputs": [], @@ -4012,7 +4010,7 @@ }, { "cell_type": "code", - "execution_count": 222, + "execution_count": 32, "id": "d4936c46", "metadata": {}, "outputs": [ @@ -4033,7 +4031,7 @@ }, { "cell_type": "code", - "execution_count": 223, + "execution_count": 33, "id": "3215c463", "metadata": {}, "outputs": [ @@ -4059,7 +4057,7 @@ }, { "cell_type": "code", - "execution_count": 224, + "execution_count": 34, "id": "bb9a5c9b", "metadata": {}, "outputs": [ @@ -4083,7 +4081,7 @@ }, { "cell_type": "code", - "execution_count": 225, + "execution_count": 35, "id": "0f0768ad", "metadata": {}, "outputs": [ @@ -4123,7 +4121,7 @@ }, { "cell_type": "code", - "execution_count": 226, + "execution_count": 36, "id": "4b8cc48d", "metadata": {}, "outputs": [], @@ -4135,7 +4133,7 @@ }, { "cell_type": "code", - "execution_count": 227, + "execution_count": 37, "id": "f0e5d591", "metadata": {}, "outputs": [], @@ -4146,7 +4144,7 @@ }, { "cell_type": "code", - "execution_count": 228, + "execution_count": 38, "id": "71177a63", "metadata": {}, "outputs": [], @@ -4165,7 +4163,7 @@ }, { "cell_type": "code", - "execution_count": 229, + "execution_count": 39, "id": "e463b9d7", "metadata": {}, "outputs": [ @@ -4202,7 +4200,7 @@ }, { "cell_type": "code", - "execution_count": 230, + "execution_count": 40, "id": "d1b84e91", "metadata": {}, "outputs": [], @@ -4213,7 +4211,7 @@ }, { "cell_type": "code", - "execution_count": 231, + "execution_count": 41, "id": "c46d32a7", "metadata": {}, "outputs": [ @@ -4277,7 +4275,7 @@ }, { "cell_type": "code", - "execution_count": 232, + "execution_count": 42, "id": "3ba2274c", "metadata": {}, "outputs": [], @@ -4291,7 +4289,7 @@ }, { "cell_type": "code", - "execution_count": 233, + "execution_count": 43, "id": "ec717a0c", "metadata": {}, "outputs": [ diff --git a/M2/Machine Learning/TP_4/2025_M2_ISF_TP_4.ipynb b/M2/Machine Learning/TP_4/2025_M2_ISF_TP_4.ipynb index 783c0a8..d8e2110 100644 --- a/M2/Machine Learning/TP_4/2025_M2_ISF_TP_4.ipynb +++ b/M2/Machine Learning/TP_4/2025_M2_ISF_TP_4.ipynb @@ -17535,7 +17535,7 @@ }, { "cell_type": "code", - "execution_count": 118, + "execution_count": null, "id": "4ff3847d", "metadata": {}, "outputs": [ @@ -17744,7 +17744,7 @@ }, { "cell_type": "code", - "execution_count": 119, + "execution_count": null, "id": "d9342ad6", "metadata": {}, "outputs": [],