Commit 9e91a175 authored by TheophilePACE's avatar TheophilePACE

supervisé V .1, clustering V.2

parent d8fa1bc4
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# TP Apprentissage supervisé: Classification / Discrimination\n",
"\n",
"Dans ce tp, on fait de la Classification / Discrimination, c'est à dire qu'on connait les \"vrais\" labels de nos classes. \n",
"\n",
"On va utiliser les données Breast cancer dataset (classification).\n",
"\n",
"Une description de ces données est disponible à https://scikit-learn.org/stable/datasets/index.html#breast-cancer-wisconsin-diagnostic-dataset. Jetez un coup d'oeil pour comprendre la probblématique.\n",
"\n",
"Importer les libraries de ce matin: numpy et scikit datasets."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Charger les données depuis datasets.load_boston. Que renvoie ceette fonction ? Charger vos données dans des variables appelées X et y opur respectivement les données et les labels."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Formatage du jeu de données\n",
"Pour entrainer nos alogrithmes, on va splitter notre jeu de données en 3 sous jeu de données: \n",
"- train\n",
"- validation\n",
"- test\n",
"\n",
"Pourquoi est-ce nécessaire?\n",
"\n",
"Pour cela, utiliser la fonction scikit-learn `sklearn.model_selection.train_test_split`. Importer cette méthode, "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# K-NNs\n",
"On va lancer les k-nns sur ce dataset.Essayer K = 1. Essayer K = n (n est le nombre de samples). Commentez."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Comment choisir K? Essayer différents K, regarder les résultats."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# NBC / Algrotihme baeysien naif\n",
"On va maintenant utiliser l'agorithme baeysien naif, naive baeysian classifier pour les gens hype. Pour rappel, le modèle se base sur l'indépendance des _features_ et l'hypothèse gaussiennee. LEs amoureux de SY01 se souviendront de la formule de bayes: \n",
"$$\n",
"P(X | Y) = \\frac{P(Y|X) \\times P(X)}{P(Y)}\n",
"$$\n",
"Bref, commencez par importer le NBC depuis scikit-learn."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Consulter la doc pour connaître les arguments demandés. Utiliser cette algorithme sur le jeu boston"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"_Optionel_ Quels sont vos résultats? Essayer d'affichier vos clusters en 2D. (un peu chaud, à voir)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Regression logistique\n",
"On va utiliser la regression logistique ou logistic regression. \n",
"Rappel de notre modèle, pour deux classes: \n",
"$$Pr(C_0 | features) + Pr(C_1 | features) = 1$$\n",
"$$Pr(C_1 | features) = \\frac{1}{1+\\exp^{w_O +w_1\\times features}}$$\n",
"On veut donc déterminer $w = (w_0,w_1)$\n",
"Et, de manière assez inattendue, Scikit propose un implémentation de la regression logistique. La doc scikit est consultable ici: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html .\n",
"\n",
"Consulter la doc, lancer une regression logistique. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Quels sont vos résultats? Sont-ils meilleurs que pour le NBC?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Le principal avantage de la regerssion logistique est son interprétabilité, grâce aux poids. \n",
"Quelles sont les features qui vous ont permi de discriminer entre les classes? Utiliser pour cela les poids du vecteurs $w$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"_optionel_ Essayez de tracer vos classes dans $R^2$, en utilisant les 2 features les plus discriminantes."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SVM -- Support Vector Machine\n",
"Machine à vecteur de Support ou Système à Vaste Marge pour les littéraires, les SVMs sont des algorithmes plus complexes. Ils perdent l'interprétabilité de la logitic regression, mais permettent d'obtenir des fronitères de décision non linéaires grâce au kernel. Très puissants, ils ont été les algorithmes phare des années 90s et début 2000s.\n",
"Le modèle est assez complexe, basé sur l'estimation de la marge. Voici pour rappel un schéma volé sur Wikipédia, qui présente le cas facilement séparable:\n",
"![](https://upload.wikimedia.org/wikipedia/commons/7/72/SVM_margin.png)\n",
"La puissance des SVM est basé sur la notion de Kernel explorée en détail ce matin. On utilisera le noyeau gaussien, appelé `rbf` dans scikit."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Étonnement, nous utiliserons l'implémentation scikit-learn. La doc est ici : https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html\n",
"importez cette méthode. Consulter la doc string ou documentation intégrée. Quels sont les paramètres?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Lancer un SVM sur nos données, avec un noyeau linéaire `kernel='linear'`. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Cela revient en fait à appliquer un classifieur linéaire sur le jeu de données. Quels sont vos résultats? Sont-ils très différents de ceux obtenus avec la regression logisitique ?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On va maintenant utiliser un noyeau non linéaire, le `rbf`. Réutilisez votre code précédent, en changeant simplement le kernel."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"C'eest fini? Pas eencore? Toujours pas? La méthode est bien plus complexe que la regression logistique. Plus complexe --> plus de calculs --> plus lent.\n",
"Quels sont vos résultats? Sont-ils meilleurs que précédemment?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"En fait, il n'y a pas que le kernel qui paramètrise votre SVM. Le paramètre de régularisation aussi.Pour l'instant quel est votre paramètre C? Regardez dans la doc.\n",
"\n",
"Essayez `C=20`. Commentez vos résultats."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Chercher un `C` optimal. Nous verrons plus tard comment faire cela automatiquement."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"_optionel_ Vous souvenez vous de la commande magic permettant de connaitre le temps pris par un ligne? `%timeit`\n",
"Comparer le temps pris par la régression logistique et le SVM."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Arbres de décision"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.6.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
......@@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"outputs": [
{
......@@ -23,7 +23,7 @@
"((506, 13), (506,))"
]
},
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
......@@ -32,11 +32,191 @@
"# Boston dataset (Régression)\n",
"# https://www.cs.toronto.edu/~delve/data/boston/bostonDetail.html\n",
"# Prix des maisons à Boston (cf le site pour les variables)\n",
"boston = load_boston()\n",
"\n",
"boston = datasets.load_boston()\n",
"X, y = boston[\"data\"], boston[\"target\"]\n",
"X.shape, y.shape"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x1a13aa97b8>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz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ZIu78P8R0haI2lY0uOSljbdw7h+Jkl6RNLdfZp/uqQ7Osu1DUv6VJ/6uKTz77FO0q2SpjYw596WrpshabWkZzpfD+1TH8WW0BuI8EuaBPwQ+AJwEnCupJMabmMPcGlE/BFwCvB3fehhrKXAcB/nvwa4JyJOBP6kH71ImgVcBLQiYi4wCTingalv5J1L110O3B8RxwP3d273o49iS+gNRPiBk4H1EfFcROwGbgMWNdlARGyNiIc737/G6C/7rCZ7eIuk2cAXgeV9mv+DwGfonMAVEbsj4pV+9MLoyWfvlzQZOBh4sdcT7m3pOkZ/H1d2vl8JnN2PPkouoTco4Z8FbB5zewt9Ch6ApDnAPOChPrVwNXAZ8Gaf5j8GGAFu6Lz0WC5pWtNNRMQLwPeBTcBW4NWIuK/pPjo+HBFbO31tBfLXW8t71yX09mdQwr+3i5z15W0ISYcAPwUujojf9WH+hcD2iFjb9NxjTAY+AVwXEfOAXTTzNPdtOq+rFwFHA4cD0ySd13Qfg6ibJfT2Z1DCvwU4Yszt2TTw9G48SQcxGvxVEXFn0/N3nAqcJWkjoy9/Pivp5oZ72AJsiYi3nvncweh/Bk37HLAhIkYi4nXgTuDTfegD4CVJHwHofM1fJXWCxiyh99eZJfQGJfy/AY6XdLSkKYwe1LmryQYkidHXuMMR8YMm5x4rIq6IiNkRMYfRx+GBiGh0bxcR24DNkk7o3DUfeKLJHjo2AadIOrjz7zOf/h0EvQs4v/P9+cDP+9HEmCX0zkovoRcRA/EHOJPRo5fPAt/qw/x/yuhLjd8Cj3b+nNnnx+TPgbv7NPfHgXbn8fgZcGif+vgn4ElgHXAT8L4G5ryV0WMMrzP6LOgC4EOMHuV/pvN1Rp/6WM/o8bG3fkd/NNH6/oSfWaUG5Wm/mTXM4TerlMNvVimH36xSDr9ZpRx+s0o5/GaVcvjNKvV/xfwjZnkF3OYAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"corr_mat = np.corrcoef(X.T)\n",
"plt.imshow(corr_mat, cmap='hot', interpolation='nearest')"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"ty = y.reshape(-1,1)\n",
"ty.shape\n",
"dataset = np.append(X,ty, axis= 1)\n",
"#plt.imshow(corr_mat, cmap='hot', interpolation='nearest')"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "Colormap cold is not recognized. Possible values are: Accent, Accent_r, Blues, Blues_r, BrBG, BrBG_r, BuGn, BuGn_r, BuPu, BuPu_r, CMRmap, CMRmap_r, Dark2, Dark2_r, GnBu, GnBu_r, Greens, Greens_r, Greys, Greys_r, OrRd, OrRd_r, Oranges, Oranges_r, PRGn, PRGn_r, Paired, Paired_r, Pastel1, Pastel1_r, Pastel2, Pastel2_r, PiYG, PiYG_r, PuBu, PuBuGn, PuBuGn_r, PuBu_r, PuOr, PuOr_r, PuRd, PuRd_r, Purples, Purples_r, RdBu, RdBu_r, RdGy, RdGy_r, RdPu, RdPu_r, RdYlBu, RdYlBu_r, RdYlGn, RdYlGn_r, Reds, Reds_r, Set1, Set1_r, Set2, Set2_r, Set3, Set3_r, Spectral, Spectral_r, Wistia, Wistia_r, YlGn, YlGnBu, YlGnBu_r, YlGn_r, YlOrBr, YlOrBr_r, YlOrRd, YlOrRd_r, afmhot, afmhot_r, autumn, autumn_r, binary, binary_r, bone, bone_r, brg, brg_r, bwr, bwr_r, cividis, cividis_r, cool, cool_r, coolwarm, coolwarm_r, copper, copper_r, cubehelix, cubehelix_r, flag, flag_r, gist_earth, gist_earth_r, gist_gray, gist_gray_r, gist_heat, gist_heat_r, gist_ncar, gist_ncar_r, gist_rainbow, gist_rainbow_r, gist_stern, gist_stern_r, gist_yarg, gist_yarg_r, gnuplot, gnuplot2, gnuplot2_r, gnuplot_r, gray, gray_r, hot, hot_r, hsv, hsv_r, inferno, inferno_r, jet, jet_r, magma, magma_r, nipy_spectral, nipy_spectral_r, ocean, ocean_r, pink, pink_r, plasma, plasma_r, prism, prism_r, rainbow, rainbow_r, seismic, seismic_r, spring, spring_r, summer, summer_r, tab10, tab10_r, tab20, tab20_r, tab20b, tab20b_r, tab20c, tab20c_r, terrain, terrain_r, viridis, viridis_r, winter, winter_r",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-41-db232998f101>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mcorr_mat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcorrcoef\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataset\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mimshow\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcorr_mat\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcmap\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'cold'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minterpolation\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'nearest'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/pyplot.py\u001b[0m in \u001b[0;36mimshow\u001b[0;34m(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, hold, data, **kwargs)\u001b[0m\n\u001b[1;32m 3203\u001b[0m \u001b[0mfilternorm\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfilternorm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilterrad\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfilterrad\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3204\u001b[0m \u001b[0mimlim\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mimlim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mresample\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mresample\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3205\u001b[0;31m **kwargs)\n\u001b[0m\u001b[1;32m 3206\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3207\u001b[0m \u001b[0max\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_hold\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mwashold\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/__init__.py\u001b[0m in \u001b[0;36minner\u001b[0;34m(ax, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1853\u001b[0m \u001b[0;34m\"the Matplotlib list!)\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mlabel_namer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1854\u001b[0m RuntimeWarning, stacklevel=2)\n\u001b[0;32m-> 1855\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0max\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1856\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1857\u001b[0m inner.__doc__ = _add_data_doc(inner.__doc__,\n",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py\u001b[0m in \u001b[0;36mimshow\u001b[0;34m(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)\u001b[0m\n\u001b[1;32m 5483\u001b[0m im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent,\n\u001b[1;32m 5484\u001b[0m \u001b[0mfilternorm\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfilternorm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfilterrad\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfilterrad\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 5485\u001b[0;31m resample=resample, **kwargs)\n\u001b[0m\u001b[1;32m 5486\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5487\u001b[0m \u001b[0mim\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/image.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ax, cmap, norm, interpolation, origin, extent, filternorm, filterrad, resample, **kwargs)\u001b[0m\n\u001b[1;32m 822\u001b[0m \u001b[0mfilterrad\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfilterrad\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 823\u001b[0m \u001b[0mresample\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mresample\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 824\u001b[0;31m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 825\u001b[0m )\n\u001b[1;32m 826\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/image.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, ax, cmap, norm, interpolation, origin, filternorm, filterrad, resample, **kwargs)\u001b[0m\n\u001b[1;32m 226\u001b[0m \"\"\"\n\u001b[1;32m 227\u001b[0m \u001b[0mmartist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mArtist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 228\u001b[0;31m \u001b[0mcm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mScalarMappable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnorm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcmap\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 229\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_mouseover\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 230\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0morigin\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/cm.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, norm, cmap)\u001b[0m\n\u001b[1;32m 201\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnorm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnorm\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 202\u001b[0m \u001b[0;31m#: The Colormap instance of this ScalarMappable.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 203\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcmap\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_cmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcmap\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 204\u001b[0m \u001b[0;31m#: The last colorbar associated with this ScalarMappable. May be None.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 205\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolorbar\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/miniconda3/lib/python3.6/site-packages/matplotlib/cm.py\u001b[0m in \u001b[0;36mget_cmap\u001b[0;34m(name, lut)\u001b[0m\n\u001b[1;32m 166\u001b[0m raise ValueError(\n\u001b[1;32m 167\u001b[0m \u001b[0;34m\"Colormap %s is not recognized. Possible values are: %s\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 168\u001b[0;31m % (name, ', '.join(sorted(cmap_d))))\n\u001b[0m\u001b[1;32m 169\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 170\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: Colormap cold is not recognized. Possible values are: Accent, Accent_r, Blues, Blues_r, BrBG, BrBG_r, BuGn, BuGn_r, BuPu, BuPu_r, CMRmap, CMRmap_r, Dark2, Dark2_r, GnBu, GnBu_r, Greens, Greens_r, Greys, Greys_r, OrRd, OrRd_r, Oranges, Oranges_r, PRGn, PRGn_r, Paired, Paired_r, Pastel1, Pastel1_r, Pastel2, Pastel2_r, PiYG, PiYG_r, PuBu, PuBuGn, PuBuGn_r, PuBu_r, PuOr, PuOr_r, PuRd, PuRd_r, Purples, Purples_r, RdBu, RdBu_r, RdGy, RdGy_r, RdPu, RdPu_r, RdYlBu, RdYlBu_r, RdYlGn, RdYlGn_r, Reds, Reds_r, Set1, Set1_r, Set2, Set2_r, Set3, Set3_r, Spectral, Spectral_r, Wistia, Wistia_r, YlGn, YlGnBu, YlGnBu_r, YlGn_r, YlOrBr, YlOrBr_r, YlOrRd, YlOrRd_r, afmhot, afmhot_r, autumn, autumn_r, binary, binary_r, bone, bone_r, brg, brg_r, bwr, bwr_r, cividis, cividis_r, cool, cool_r, coolwarm, coolwarm_r, copper, copper_r, cubehelix, cubehelix_r, flag, flag_r, gist_earth, gist_earth_r, gist_gray, gist_gray_r, gist_heat, gist_heat_r, gist_ncar, gist_ncar_r, gist_rainbow, gist_rainbow_r, gist_stern, gist_stern_r, gist_yarg, gist_yarg_r, gnuplot, gnuplot2, gnuplot2_r, gnuplot_r, gray, gray_r, hot, hot_r, hsv, hsv_r, inferno, inferno_r, jet, jet_r, magma, magma_r, nipy_spectral, nipy_spectral_r, ocean, ocean_r, pink, pink_r, plasma, plasma_r, prism, prism_r, rainbow, rainbow_r, seismic, seismic_r, spring, spring_r, summer, summer_r, tab10, tab10_r, tab20, tab20_r, tab20b, tab20b_r, tab20c, tab20c_r, terrain, terrain_r, viridis, viridis_r, winter, winter_r"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAAD8CAYAAACVSwr3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAADJlJREFUeJzt22GI5Hd9x/H3x1xTaRq1mBXk7jSRXqrXUIhd0hShRkzLJYW7JyJ3EFpL8NAa+0AppFhSiY8aaQXhWnu0EhU0nj6oi5wEtBGLeJoN0ehduLI9bbNEmlPTPBGNod8+mNFO5rt7+7/L7Mwtfb9gYf7/+c3sd4e59/7nv/9LVSFJk1606AEkXX4Mg6TGMEhqDIOkxjBIagyDpGbLMCT5aJKnknxnk/uT5MNJ1pI8luT1sx9T0jwNOWK4HzhwgftvA/aNv44Cf//Cx5K0SFuGoaq+AvzoAksOAR+vkVPAy5K8clYDSpq/XTN4jt3AExPb6+N9359emOQoo6MKrrrqqt9+7WtfO4NvL2kzjzzyyA+qauliHzeLMGSDfRteZ11Vx4HjAMvLy7W6ujqDby9pM0n+41IeN4u/SqwDeye29wBPzuB5JS3ILMKwAvzR+K8TNwPPVFX7GCFp59jyo0SSTwG3ANckWQf+CvglgKr6CHASuB1YA34M/Ml2DStpPrYMQ1Ud2eL+At41s4kkLZxXPkpqDIOkxjBIagyDpMYwSGoMg6TGMEhqDIOkxjBIagyDpMYwSGoMg6TGMEhqD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+6JPqFmNnl1HMweI4kdwDLwBu3daILu+C8SV7E6H+6vm1eA13AkNd2F6OPE7cwOhL71yQ3VNV/b/NsGxky7xHg/qr6myS/y+g6nhuq6n+2f7yLdtH/xrb7iGEnXU49ZFaS3Aq8DzhYVT+d02wb2Wreq4EbgC8n+R6jz5YrCzoBOfR98Lmq+llVfRc4yygUizBk3juBEwBV9TXgxYz+g9XlaNB7+3m2+aTILuAccB3/dxLnN6fWvIvnn3w8saATOENmvZHRSal9i5jxYuedWv9lFnfycchrewD42Pj2NYwOfV9+Gc/7BeBt49uvG/9DywLfD9ey+cnHP+T5Jx+/seXzzWHg24F/G/+Det94372MfuPCqLSfAdaAbwCvWeCLu9WsXwT+C/jm+GtlUbMOmXdq7cLCMPC1DfC3wBng28Dhy/m1ZfSXiK+Oo/FN4A8WOOungO8DP2N0dHAn8A7gHROv7bHxz/LtIe8DL4mW1Hjlo6TGMEhqDIOkxjBIagyDpMYwSGoMg6TmfwEval/UlBeDXwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"corr_mat = np.corrcoef(dataset.T)\n",
"plt.imshow(corr_mat, cmap='cold', interpolation='nearest')"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mDocstring:\u001b[0m\n",
"concatenate((a1, a2, ...), axis=0, out=None)\n",
"\n",
"Join a sequence of arrays along an existing axis.\n",
"\n",
"Parameters\n",
"----------\n",
"a1, a2, ... : sequence of array_like\n",
" The arrays must have the same shape, except in the dimension\n",
" corresponding to `axis` (the first, by default).\n",
"axis : int, optional\n",
" The axis along which the arrays will be joined. If axis is None,\n",
" arrays are flattened before use. Default is 0.\n",
"out : ndarray, optional\n",
" If provided, the destination to place the result. The shape must be\n",
" correct, matching that of what concatenate would have returned if no\n",
" out argument were specified.\n",
"\n",
"Returns\n",
"-------\n",
"res : ndarray\n",
" The concatenated array.\n",
"\n",
"See Also\n",
"--------\n",
"ma.concatenate : Concatenate function that preserves input masks.\n",
"array_split : Split an array into multiple sub-arrays of equal or\n",
" near-equal size.\n",
"split : Split array into a list of multiple sub-arrays of equal size.\n",
"hsplit : Split array into multiple sub-arrays horizontally (column wise)\n",
"vsplit : Split array into multiple sub-arrays vertically (row wise)\n",
"dsplit : Split array into multiple sub-arrays along the 3rd axis (depth).\n",
"stack : Stack a sequence of arrays along a new axis.\n",
"hstack : Stack arrays in sequence horizontally (column wise)\n",
"vstack : Stack arrays in sequence vertically (row wise)\n",
"dstack : Stack arrays in sequence depth wise (along third dimension)\n",
"\n",
"Notes\n",
"-----\n",
"When one or more of the arrays to be concatenated is a MaskedArray,\n",
"this function will return a MaskedArray object instead of an ndarray,\n",
"but the input masks are *not* preserved. In cases where a MaskedArray\n",
"is expected as input, use the ma.concatenate function from the masked\n",
"array module instead.\n",
"\n",
"Examples\n",
"--------\n",
">>> a = np.array([[1, 2], [3, 4]])\n",
">>> b = np.array([[5, 6]])\n",
">>> np.concatenate((a, b), axis=0)\n",
"array([[1, 2],\n",
" [3, 4],\n",
" [5, 6]])\n",
">>> np.concatenate((a, b.T), axis=1)\n",
"array([[1, 2, 5],\n",
" [3, 4, 6]])\n",
">>> np.concatenate((a, b), axis=None)\n",
"array([1, 2, 3, 4, 5, 6])\n",
"\n",
"This function will not preserve masking of MaskedArray inputs.\n",
"\n",
">>> a = np.ma.arange(3)\n",
">>> a[1] = np.ma.masked\n",
">>> b = np.arange(2, 5)\n",
">>> a\n",
"masked_array(data = [0 -- 2],\n",
" mask = [False True False],\n",
" fill_value = 999999)\n",
">>> b\n",
"array([2, 3, 4])\n",
">>> np.concatenate([a, b])\n",
"masked_array(data = [0 1 2 2 3 4],\n",
" mask = False,\n",
" fill_value = 999999)\n",
">>> np.ma.concatenate([a, b])\n",
"masked_array(data = [0 -- 2 2 3 4],\n",
" mask = [False True False False False False],\n",
" fill_value = 999999)\n",
"\u001b[0;31mType:\u001b[0m builtin_function_or_method\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"np.concatenate?"
]
},
{
"cell_type": "code",
"execution_count": 22,
......@@ -159,7 +339,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.6.6"
},
"toc": {
"colors": {
......
......@@ -67,34 +67,6 @@
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Formatage du jeu de données"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pour entrainer nos alogrithmes, on va splitter notre jeu de données en 3 sous jeu de données: \n",
"- train\n",
"- validation\n",
"- test\n",
"\n",
"Pourquoi est-ce nécessaire?\n",
"\n",
"Pour cela, utiliser la fonction scikit-learn `sklearn.model_selection.train_test_split`. Importer cette méthode, "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
......
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