M2_SETI/D3/TP/TP_SETI_SVM/SVM.ipynb

276 lines
92 KiB
Text
Raw Normal View History

2022-12-29 17:27:20 +01:00
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# TP 3 SVM\n",
"On se propose de faire de la modélisation par SVM sur des problématiques de discrimination, en utilisant la bibliothèque scikit-learn.\n",
"\n",
"On veut : \n",
"- Traiter un problème de discrimination linéairement séparable\n",
"- Traiter un problème non linéairement séparable (SVM à noyaux)\n",
"- Traiter le problème de la discrimination de chiffres manuscrits"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Problème linéairement séparable"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 120,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from sklearn.svm import SVC"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 121,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"def genere_ex_1(n1=100, n2=50, mu1=[0,3], mu2=[3,0], sd1=0.15, sd2=0.2):\n",
2023-01-12 16:00:39 +01:00
" \"\"\" Génération de point\n",
" \"\"\"\n",
2022-12-29 17:27:20 +01:00
" X = np.concatenate((np.random.multivariate_normal(mu1, np.diagflat(sd1*np.ones(2)), n1),\n",
" np.random.multivariate_normal(mu2, np.diagflat(sd2*np.ones(2)),n2)))\n",
"\n",
" Y = np.concatenate((np.ones((n1,1)), -1*np.ones((n2,1))))[:,0]\n",
" return X,Y"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 122,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"def plot_data_hyperplan(X, Y, classifier, name):\n",
2023-01-12 16:00:39 +01:00
" \"\"\" Affichage du classifieur \n",
" \"\"\"\n",
2022-12-29 17:27:20 +01:00
" w = classifier.coef_[0]\n",
" b = classifier.intercept_[0]\n",
" a = -w[0] / w[1]\n",
" xx = np.linspace(min(X[:,0]), max(X[:,0]))\n",
" yy = a * xx - b/w[1]\n",
"\n",
" color = ['red' if c >= 0 else 'blue' for c in Y]\n",
" plt.scatter(X[:,0], X[:,1], color=color)\n",
"\n",
" plt.plot(xx,yy, color='black')\n",
2023-01-12 16:00:39 +01:00
" plt.plot(xx, yy+1/w[1], color='green')\n",
" plt.plot(xx, yy-1/w[1], color='green')\n",
2022-12-29 17:27:20 +01:00
" plt.xlabel(\"x1\")\n",
" plt.ylabel(\"x2\")\n",
" plt.title(\"Classe 1 (red), Classe -1 (blue)\")\n",
" plt.show()"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 123,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"def main(X,Y):\n",
" classifier = SVC(kernel='linear', probability=True)\n",
" classifier = classifier.fit(X, Y)\n",
"\n",
" plot_data_hyperplan(X, Y, classifier, 'Graph_SVM_linear')"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 135,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [
{
"data": {
2023-01-12 16:00:39 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEWCAYAAABv+EDhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABdtElEQVR4nO2dd3iURdfG70nvhN6L9N4SEBQFQemC0pUOQjbWV31fu58REUERFcXdBEJHpKMogiBNRMqG3nvvgYQQUnfv749JIGU32YRNnmR3ftf1XMk+ZeY8s8mcmTNnzhEkoVAoFArnw0VrARQKhUKhDUoBKBQKhZOiFIBCoVA4KUoBKBQKhZOiFIBCoVA4KUoBKBQKhZOiFICTIoQIE0LM11qO/CKE+EcI0cJOZdUQQlAI4Zb2eZkQops9yrZ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uZ2wm3M2TcHBqMBx6KPoaRXSbzW+jWEBIWgXpl6uRdQQCgFoFAoFAUASey6vAt6ox4/H/wZiamJaFOlDWb1noWBjQbC291baxGVAlAoFAp7cjf5LhYeWAi9UY89V/fA190Xw5sNR0hQCFpUbKG1eJlQCkChUCjswIFrB2AwGjBv/zzEJcehSbkmmNZ9GoY0HYIAzwCtxbOIUgAKhUKRTxJTE7Hs8DLojXr8c+EfeLp6YkCjAdAF69C2SlsIIbQWMUeUAlAoFIo8cvLWSYQbwzFr7yxEJ0SjdqnamPzMZAxvPhxlfMpoLZ7NKAWgUCgUNpBqTsWqY6ugN+qx7vQ6uApX9K7fG6HBoej4SEe4iOKXYVcpAIVCociBi3cuYsbuGZi+ezoux11GlYAqGNdhHEa3HI1K/pW0Fu+hUApAoVAosmCmGet
2022-12-29 17:27:20 +01:00
"text/plain": [
2023-01-12 16:00:39 +01:00
"<Figure size 432x288 with 1 Axes>"
2022-12-29 17:27:20 +01:00
]
},
2023-01-12 16:00:39 +01:00
"metadata": {
"needs_background": "light"
},
2022-12-29 17:27:20 +01:00
"output_type": "display_data"
}
],
"source": [
"X, Y = genere_ex_1() \n",
"main(X, Y)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Problème non linéairement séparable\n"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 136,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"from sklearn.model_selection import GridSearchCV"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 137,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"def genere_ex_2(n=300, mu=[0,0], std=0.25, delta=0.2):\n",
2023-01-12 16:00:39 +01:00
" \"\"\" Génération de données de nuage gaussien centré en 0 et traversé par une fonction polynomiale de degré 3\n",
" \"\"\"\n",
2022-12-29 17:27:20 +01:00
" X = np.random.multivariate_normal(mu, np.diagflat(std*np.ones(2)), n)\n",
" Y = np.zeros((X.shape[0]))\n",
"\n",
" for i in range(X.shape[0]):\n",
" x = X[i,0]\n",
" y = X[i,1]\n",
" if y < x*(x-1)*(x+1):\n",
" Y[i] = -1\n",
" X[i,1] = X[i,1] - delta\n",
" else:\n",
" Y[i] = 1\n",
" X[i,1] = X[i,1] + delta\n",
" return X,Y"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 138,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"def plot(X,Y,classifier, nameFig):\n",
2023-01-12 16:00:39 +01:00
" \"\"\" Visualisation\n",
" \"\"\"\n",
2022-12-29 17:27:20 +01:00
" minx1 = min(X[:,0])\n",
" maxx1 = max(X[:,0])\n",
" minx2 = min(X[:,1])\n",
" maxx2 = max(X[:,1])\n",
"\n",
" xx = np.linspace(minx1, maxx1, 100)\n",
" yy = np.linspace(minx2, maxx2, 100).T\n",
" xx, yy = np.meshgrid(xx,yy)\n",
" Xfull = np.c_[xx.ravel(), yy.ravel()]\n",
"\n",
" probas = classifier.predict_proba(Xfull)\n",
" Z = classifier.decision_function(Xfull)\n",
"\n",
" k = 1\n",
" plt.title(\"Class %d\" %k)\n",
" imshow_handle = plt.imshow(probas[:, k].reshape((100,100)), extent=(minx1, maxx1, minx2, maxx2), origin='lower')\n",
" \n",
" classPos = Y>=0\n",
" classNeg = Y<0\n",
"\n",
" plt.contour(xx, yy, Z.reshape((100,100)), [-1,0,1], colors=['blue', 'black', 'red'])\n",
" plt.scatter(X[classPos, 0], X[classPos, 1], marker='o', c='r', edgecolors='k')\n",
" plt.scatter(X[classNeg, 0], X[classNeg, 1], marker='o', c='b', edgecolors='k')\n",
"\n",
" ax = plt.axes([0.8, 0.15, 0.05, 0.7])\n",
"\n",
" plt.title('Probability')\n",
" plt.colorbar(imshow_handle, cax=ax, orientation='vertical')\n",
" \n",
" plt.savefig(nameFig+'.jpg', dpi=300)\n",
" plt.show()\n",
" plt.close()"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 139,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"def main(X,Y,nameFig = 'GridSearchCV'):\n",
2023-01-12 16:00:39 +01:00
" \"\"\" Création du modèle avec la recherche du meilleur paramétrage de GridSearchCV \n",
" \"\"\"\n",
2022-12-29 17:27:20 +01:00
" parameters = {'kernel':('poly', 'poly'), 'C':[0.1,0.5, 1, 10], 'degree':[3,5], 'coef0':[0, 0.1, 0.5, 1, 10]}\n",
" svc = SVC(probability=True)\n",
" classifier = GridSearchCV(svc, parameters)\n",
" classifier = classifier.fit(X,Y)\n",
" print(classifier.best_params_)\n",
"\n",
" plot(X,Y, classifier=classifier, nameFig=nameFig)"
]
},
{
"cell_type": "code",
2023-01-12 16:00:39 +01:00
"execution_count": 144,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2023-01-12 16:00:39 +01:00
"{'C': 10, 'coef0': 0.5, 'degree': 3, 'kernel': 'poly'}\n"
2022-12-29 17:27:20 +01:00
]
},
{
"data": {
2023-01-12 16:00:39 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAUEAAAEICAYAAADBWUaVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAACdpUlEQVR4nOydd5wkdZn/398KnSbvhJ2ZzQlYgmQki+IpIAK7KLIgQTAdwp3nKcIdHiriInrneZh+KghIEmQxZ0RwFQQkboDNYeLO7MQO1RW+398f3+qenpme2VmY3Zndnc+86tU91dXV1d3VTz3h83weoZRiClOYwhQOVBgTfQBTmMIUpjCRmDKCU5jCFA5oTBnBKUxhCgc0pozgFKYwhQMaU0ZwClOYwgGNKSM4hSlM4YDGlBGcwjAIIT4vhLhvoo9jClPYG5gyggcohBCXCCGeF0IkhR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NE4EepVSI4bCME6eoBDiQeAM9BSzJuBm9DmbI16+D/hnIYSPlk6/eHcJjVPYd7C22efUIetODdfn7o/02O7ua3+Czgcq1Cawk5JVixpJp2J421qJxCuIBzHaHW0ES5hYI6hQ+ULO3sQYbM2v0TJhG4A08KFd7XNcjKBSalQ5HKXUNxneSD2FCcDeyK8tnmGxcohYwspwPTDqY7u7r/0FgVJINFG65GUPgNUHNyJ9gdvWSkl5AyJQpNw6TOEQUx0TTo+Ru5Ku2QMYg61RwCd2Z59THSMHEHL5tTuafBwFdzT5fO7THTy4om/XT94NjCaWsLtCCvuz8EJhKAzgKoWnIPGyixs3WVXfgOwFt6Od0kQ9Rtan36vXleFhzW57FwrwkOO+TAT
2022-12-29 17:27:20 +01:00
"text/plain": [
2023-01-12 16:00:39 +01:00
"<Figure size 432x288 with 2 Axes>"
2022-12-29 17:27:20 +01:00
]
},
2023-01-12 16:00:39 +01:00
"metadata": {
"needs_background": "light"
},
2022-12-29 17:27:20 +01:00
"output_type": "display_data"
}
],
"source": [
"X,Y = genere_ex_2()\n",
"main(X,Y)"
]
}
],
"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",
2023-01-12 16:00:39 +01:00
"version": "3.9.4"
2022-12-29 17:27:20 +01:00
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
2023-01-12 16:00:39 +01:00
"hash": "2ef431f6525756fa8a44688585fa332ef3b2e5fcfe8fe75df35bbf7028a8b511"
2022-12-29 17:27:20 +01:00
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}