Commit 77a00496 authored by TheophilePACE's avatar TheophilePACE

clustereing v 1

parent 7e6d2252
......@@ -28,7 +28,50 @@
"source": [
"Maintenant, on va utiliser les fonctions suivantes de la librairie `dataset` : `datasets.make_circles`, `datasets.make_moons`, `datasets.make_blobs`, `datasets.make_blobs`.\n",
"Consultez la documentation intégrée de ces méthodes.\n",
"Vous pouvez trouver des exemples d'utilisation de ces méthodes sur https://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html "
"Vous pouvez trouver des exemples d'utilisation de ces méthodes sur https://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html \n",
"On prendra 1500 individus."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"ename": "NotImplementedError",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNotImplementedError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-bcd56d7d0c52>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mNotImplementedError\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mnoisy_circles\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_circles\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfactor\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnoise\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m.05\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mnoisy_moons\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_moons\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnoise\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m.05\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mblobs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_blobs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_state\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m8\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mvaried\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatasets\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_blobs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mn_samples\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcluster_std\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1.0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrandom_state\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mrandom_state\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNotImplementedError\u001b[0m: "
]
}
],
"source": [
"raise NotImplementedError(\"préciser n_samples\")\n",
"noisy_circles = datasets.make_circles(n_samples=n_samples, factor=.5, noise=.05)[0]\n",
"noisy_moons = datasets.make_moons(n_samples=n_samples, noise=.05)[0]\n",
"blobs = datasets.make_blobs(n_samples=n_samples, random_state=8)[0]\n",
"std_blobs = datasets.make_blobs(n_samples=n_samples, cluster_std=[1.0, 2.5, 0.5], random_state=random_state)[0]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Analyse exploratoire\n",
"Effectuer une pré analyse du jeu de données, afin de vous donner une intuition du jeu de données. Pour rappel, voici quelques étapes possibles:\n",
"- Lecture des infos données avec le dataset afin de connaître le contexte\n",
"- Prise en compte de la question associée au dataset\n",
"- Regarder la forme (shape) du dataset\n",
"- Faire quelques visualisations\n",
"- Chercher des valeurs aberrantes pour se donner une idée de la qualité du dataset\n",
"- Regarder la nature des variables (catégorielle, numérique, binaire), leur unité\n",
"==> se donner une intuition du dataset\n",
"- effectuer PCA + vizualisation\n",
"- Le jeu de données est équilibré? (entre les classes, aura une influence sur les seuils)"
]
},
{
......@@ -57,9 +100,37 @@
"metadata": {},
"source": [
"Tracer les données générées dans le plan ($R^2$).\n",
"Commenter la difficulté du clustering."
"Commenter la difficulté du clustering. Utiliser la fonction `plt.scatter(X[:, 0], X[:, 1], s=10)`"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x1a1cce35c0>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3X1wFGd+J/Dv0yMNEkhCCAYBQsiAhDgZyoApgxdjTAGLz+UEb+pyteCN90zKXrJssfnDrmwqdb4tJ38kYS+psMUuWedw4l2wE19u17497yqyTzayj5cAxovQIiTAQi8gRgi9gcRopp/7o6eb7p6eNzQ9M9J8P1UUzExP96O2/Ounf/17nkdIKUFERFOfkukGEBFRejDgExHlCAZ8IqIcwYBPRJQjGPCJiHIEAz4RUY5gwCciyhEM+EREOYIBn4goR+RlugFmc+bMkQ899FCmm0FENKmcOXOmT0rpi7ddVgX8hx56CKdPn850M4iIJhUhREci2zGlQ0SUIxjwiYhyBAM+EVGOYMAnIsoRDPhERDmCAZ+IKEdkVVkmEZFdQ0svmtr82Fjjw7a68kw3Z1JjD5+IslZDSy/2vf053jregX1vf46Glt5MN2lSY8AnoqzV1ObH6HgIADA6HkJTm/+B99XQ0ovX3mvO6YsGAz4RZVy0YLyxxofCfA8AoDDfg401kbMHJBLIk7lTmMoXBiGlzHQbDGvXrpWcWoEou7idQ9eD8eh4CIX5HhzYudpynFjHj/ddfZsf1F9Ea++I8d4Lj1fh9R0rkm5LthJCnJFSro23HR/aElFU5gD47ukuVwJgtLSNOcg7BfGmNj86++9GfNd+sdDbrzPfKdgvJk5tmQwBP1EM+EQUVToC4MYaH9493WX0qosL8mNeZMxB3OtR4PUoCIRUx0BuviAAQG15EV7Zvhzb6sodL2b2tthTSJO9YogBn4iiihcAH5Q9cB7YuRpHT2oTPrb0DFouMj+ovwgARoA9erLD+DwQUlFVNh2ban3GvmJdEPRgDzhfzF7fs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q0SMVrp04I8QaAXzp81AWg0vR6IYCeFDTNkMC5/CaAZwFskeEEpMM+XD+XNomcF32brvDvw0xE3n67SgiRDy3YH5FS/i/75+YLgJTyAyHEj4QQc6SUaZsbJoH/dq7/DibhPwI4K6XstX+QDecyrFcIMV9KeT2c+rrpsE0XtGcOuoUAPna7YVM5pbMVwEUpZZfTh0KIGUKIYv3f0B5ONjtt6xZbHvRrUY7/7wBqhBCLw72brwN4Px3tA7RKGAB/AuB3pZR3o2yTiXOZyHl5H4Be/fCfAPzfaBcsN4SfF/wPAL+VUv5NlG3m6c8VhBCPQft/8lYa25jIf7v3AbwQrtZZD2BQT1lkQNS79kyfSxPz7903AbznsE09gK8KIWaFU7lfDb/nrnQ+0U7nHwD/CGCP7b0FAD4I/3sJtMqOLwBcgJa+SHcbfwrgPIDfQPslmW9vZ/j1M9AqPC6nu50A2qHlGs+F/xyytzFT59LpvAB4HdrFCQAKALwb/hlOAViS5nP3BLTb9N+Yzt8zAPbov5sAvhM+Z19Aeyj+lTS30fG/na2NAsDB8Hk+D2BtOttoaut0aAF8pum9jJ5LaBef6wDGofXa/xDac6KPALSF/y4Lb7sWwD+Yvrs7/LvZDuDFdJxDjrQlIsoRUzmlQ0REJgz4REQ5ggGfiChHMOATEeUIBnwiohzBgE9ElCMY8ImIcgQDPhFRjvj/0lNloQgqHbAAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
......@@ -71,21 +142,22 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Formatage du jeu de données"
"__Pour commencer, on fera toutes les analyses sur le dataset blobs. Ensuite, on essaiera sur les autres datasets__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pour entrainer nos algorithmes, on va splitter notre jeu de données en 3 sous-jeux de données: \n",
"- train\n",
"- validation\n",
"- test\n",
"# K-means\n",
"Utilisez les k-means sur chacun des datasets. C'est ici https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html __Conseil:__ : Une cellule par dataset pour plus de clarté.\n",
"Pour rappel, cela consiste à chercher à minimiser un critère (en l'occurence la viriance intra-classe, c'est à dire la distance de chaque point au milieu de sa classe) de manière itérative. Par exemple, sur ce schéma volé à wikipédia:\n",
"\n",
"\n",
"Pourquoi est-ce nécessaire?\n",
"![](https://upload.wikimedia.org/wikipedia/commons/e/ea/K-means_convergence.gif)\n",
"\n",
"Pour cela, utilisez la fonction scikit-learn `sklearn.model_selection.train_test_split`. Importez cette méthode, "
"\n",
"Utiliser la méthode des k-means de la documentation scikit-learn sur le dataset blobs."
]
},
{
......@@ -99,8 +171,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# K-means\n",
"Utilisez les k-means sur chacun des datasets. __Conseil:__ : Une cellule par dataset pour plus de clarté."
"Comment avez-vous choisi K ? Faites quelques tests, commentez les résultats. Gardez le meilleur hyperparmètre K. "
]
},
{
......@@ -114,7 +185,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Comment avez-vous choisi K ? Faites quelques tests, commentez les résultats. Gardez le meilleur hyperparmètre K. "
"Relancez plusieurs fois pour le dataset. Obtenez-vous les mêmes résultats?"
]
},
{
......@@ -128,7 +199,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Relancez plusieurs fois pour chaque dataset. Obtenez-vous les mêmes résultats? Si non, pourquoi?"
"Maintenant, utiliser les k-means sur les autres datasets:\n",
"- std_blobs\n",
"- noisy moons\n",
"- circles"
]
},
{
......@@ -138,12 +212,30 @@
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ACP / PCA / Principal Components Analysis\n",
"On a vu la PCA ce matin. La fonction Scikit pour cette transformation est `sklearn.decomposition.PCA`. À vrai dire, c'est un objet. Consulter la documentation rapidemment : https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html ou la doc intégrée.\n",
"On a vu la PCA ce matin. Cette technique consiste à effectuer une rotation dans l'espace vectoriel des données, afin de maximiser la variance (qui correspond à l'information portée par une variable) sur chaque axe. Par exemple, dans $R^2$:\n",
"\n",
"![](https://upload.wikimedia.org/wikipedia/commons/f/f5/GaussianScatterPCA.svg)\n",
"\n",
"La fonction Scikit pour cette transformation est `sklearn.decomposition.PCA`. À vrai dire, c'est un objet. Consulter la documentation rapidemment : https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html ou la doc intégrée.\n",
"Effectuez une PCA sur vos données avec 2 composantes. "
]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment