M2_SETI/D3/TP/TP_SETI_SVM/SVM.ipynb

276 lines
89 KiB
Text
Raw Permalink 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-29 16:56:40 +01:00
"execution_count": 145,
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-29 16:56:40 +01:00
"execution_count": 146,
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-29 16:56:40 +01:00
"execution_count": 147,
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-29 16:56:40 +01:00
"execution_count": 148,
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-29 16:56:40 +01:00
"execution_count": 149,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [
{
"data": {
2023-01-29 16:56:40 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEWCAYAAABv+EDhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABcjElEQVR4nO2dZ3hVVdaA353e6VXpvSSIFBWR3kR6J/eGsTuOZRw/e5vYC451LOPojCMn9CoICKIUBUVETULoHaRDIKQnd30/dgIhuQkJKSdlv89znuSess865yZr7b322mspEcFgMBgMVQ8PuwUwGAwGgz0YA2AwGAxVFGMADAaDoYpiDIDBYDBUUYwBMBgMhiqKMQAGg8FQRTEGoIqilIpUSll2y3GlKKV+UEp1LqG2miqlRCnllfV5nlLq5pJo2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AZ5sQZ5qRHox54qPK91tZWAyAih7N+HldKLQC6A2tznfMJ8AlA165dpcyFNBgMhhzsPbOXqJgorGiL7ae24+Ppw/DWw3GGObm55c34evnaLWKhsc0AKKUCAQ8RScj6fRDwgl3yGAwGQ36cSjrFnLg5WNEWPxz8AYBeTXrx8A0PM779eGr417BZwivDzhFAPWBBVryrFzBdRJbbKI/BYDBcICUjhSU7lmBFWyzduZR0Vzrt67TnlX6vEB4aTpPqTewWsdjYZgBEZA/Qya77GwwGQ25c4mLt/rVY0RZz4+ZyNvUs9YPqc3/3+4kIi+Ca+teU2SKtssDuSWCDwWCwndjjsRcWaR06d4ggnyDGthuLM8xJ36Z98fTwtFvEUsE
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-29 16:56:40 +01:00
"execution_count": 150,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [],
"source": [
"from sklearn.model_selection import GridSearchCV"
]
},
{
"cell_type": "code",
2023-01-29 16:56:40 +01:00
"execution_count": 151,
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-29 16:56:40 +01:00
"execution_count": 152,
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-29 16:56:40 +01:00
"execution_count": 153,
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-29 16:56:40 +01:00
"execution_count": 154,
2022-12-29 17:27:20 +01:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2023-01-29 16:56:40 +01:00
"{'C': 1, 'coef0': 0.5, 'degree': 3, 'kernel': 'poly'}\n"
2022-12-29 17:27:20 +01:00
]
},
{
"data": {
2023-01-29 16:56:40 +01:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAATAAAAEICAYAAADY0qgzAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAACYe0lEQVR4nOydd5wdZdn+v8+U07an7246CRCK9KYIKqKCiCQIEpAiiCLFLsXyCjaK7VXEDtJBkIDoiz8LohIFBEUpCaSRtrtJdrP91JnneX5/PDOn7dlkA0uyG8+Vz3zOZs6cmTnnzLnnLtd93UJrTRVVVFHFeIS1q0+giiqqqOLVomrAqqiiinGLqgGroooqxi2qBqyKKqoYt6gasCqqqGLcomrAqqiiinGLqgHbzSCEuFoIceeuPo8qqtgZqBqwcQghxJlCiGeEEINCiA4hxG+FEEfvonP5ihDieSGEL4S4elecQxX/vagasHEGIcSngP8Fvg5MBWYCPwDeu4tOaRVwOfB/u+j4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WtkcTA36UZFIge/uINk7G9jTCU6T9RmJWDyg1pnlgGvBQo77sClQN2DhHVXFi9FHunSgg9pJPckaEgUQMX1mk2vpAa6KNkxAS/GwMpSPErO4xl7Qvhyagh4zysiswKrdpIcQtwEnAFq31fhWefwumC/6VYNUSrfWXR+PY/+0I81yXXdvN8jafBa0OX7lqQjX/9SowpP8xSE1LDbHlHt1715BVLik/QnKjaeKO1k5C9Gmy6ToAYiLQAByj+a8QY7vEMHKMVpxxK0b8bFtaPo9rrU8apePtlrhnST/XFhmiq0ZoiKqKE68fpNbojCa+1qP7hBoyyiUrHTL
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-29 16:56:40 +01:00
"version": "3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)]"
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
}