diff --git a/Amrin_ML.ipynb b/Amrin_ML.ipynb new file mode 100644 index 000000000..6e6d2a6ea --- /dev/null +++ b/Amrin_ML.ipynb @@ -0,0 +1,983 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Regression Intuitions" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "***Simple Linear Regression:*** A Simple linear equation models a function such that if we give any x to it, it will predict a value y , where both x and y are input and output variables respectively. These are numerical and continuous values. It is the most simple and well known algorithm used in machine learning.\n", + "\n", + "**y = mx + c**\n", + "\n", + "***Multiple Linear Regression:*** A multiple linear equation models a function such that if we give more than one feature variable like x1 x2 ….xi to it, it will predict the target output value y .\n", + "\n", + "**yi=β0+β1xi1+β2xi2+...+βpxip+ϵ ;** where, for i=n observations:\n", + "\n", + "*We are using multiple linear regression model:*\n", + "\n", + "​" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Importing the libraries" + ] + }, + { + "cell_type": "code", + "execution_count": 122, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Importing the dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 123, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
R&D SpendAdministrationMarketing SpendStateProfit
0165349.20136897.80471784.10New York192261.83
1162597.70151377.59443898.53California191792.06
2153441.51101145.55407934.54Florida191050.39
3144372.41118671.85383199.62New York182901.99
4142107.3491391.77366168.42Florida166187.94
\n", + "
" + ], + "text/plain": [ + " R&D Spend Administration Marketing Spend State Profit\n", + "0 165349.20 136897.80 471784.10 New York 192261.83\n", + "1 162597.70 151377.59 443898.53 California 191792.06\n", + "2 153441.51 101145.55 407934.54 Florida 191050.39\n", + "3 144372.41 118671.85 383199.62 New York 182901.99\n", + "4 142107.34 91391.77 366168.42 Florida 166187.94" + ] + }, + "execution_count": 123, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = pd.read_csv('50_Startups.csv')\n", + "df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "50" + ] + }, + "execution_count": 124, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(df)" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(50, 5)" + ] + }, + "execution_count": 125, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.shape" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Plotting the dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 126, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEWCAYAAABbgYH9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAr8UlEQVR4nO3de5hcVZ3u8e9rEmMj5gJEJnSCCYIoF01MG3GiiOAQ8EZEHML4DEHRCIOPeMbhmOgcQRgk6CiKFxgcOFzkOoAhKjkQicioEOgYJASIBAnSnQwEkwBKhkni7/yxV5HdRVV1d7p3VXfX+3meemrX2nvtWrs6qV+t61ZEYGZm1t9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AtwF/CplP5t4NsR8Taqr1l1OzBR0u8kfV/Su8v2PxcR08lmmn8rd94L0nk/Avx77vg3AjOB6cCZkkZImka25MlU4FjgbVXKYk3MTWRmQEQ8kJbrPwG4tWz3aOAKSfuRLSszIrdvSURszL1+E3AJcGRErEurEh8ELEk3NxxGtjRPd/4HKPXnLCdrtoMsoM1K29cA/1rhWv6UAsC7gPcA10uaFxGXp0OuzT1fkLbfCxyQyggwStJr0vZPU23oRUlPA3umc/8oIl4AkLSoB9dkTcYBxmyHRWRf2IeRrUNVcg7w84j4cApCd+b2/bnsHOvJ1p2aSlbDELAqIt7Ry7JsjR3rOG2nl/9XI2J7KuedklYCc4DLS7vzh6bnV5DdEKtLTSoFnBdzSfmyeJ0pq8lNZGY7XAacHREry9JHs6PT/6RuzrGZrC/nq5IOI1sMcVzqeCc1Lx2Yjn2e7DbNvXEPWRMWZE1ULyNp/1TbKpkCPJF7fXzu+e60fTvwmdw5pnRTjruAD6e+o9cAH+xJ4a25OMCYJRHRERHfrrDra8B5kn5F1sTV3XmeIvvC/R5ZTeY44HxJvyVbrfmv06GXAxeXOvl7WMzPAf8o6V6yzvxnKxyzK1mT3kOSHiC7h/xZuf0jJS0DTgf+V0r7LNCWhjU/BJzSzTX+Brg+Xc9NZEv8m3Xh1ZTNBhFJuwBbIiIkzSa7f/sxvci/FmiLiGeKKqNZiftgzAaXacB3lXWObCa7l4jZgOQajJmZFcJ9MGZmVggHGDMzK4QDjJmZFcIBxszMCuEAY2Zmhfj/aRRC6PnKFhoAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.scatter(df['Marketing Spend'], df['Profit'])\n", + "#plt.plot(X_train, regressor.predict(X_train), color = 'blue')\n", + "plt.title('Marketing Spend vs Profit')\n", + "plt.xlabel('Marketing Spend')\n", + "plt.ylabel('Profit')\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 127,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Vkt6U5J76vyHm+Q9O+SHpD0iKRbCr6t0urW+xb9PjYyOMGYDczWiJgaEYeTzaQ+LbfvTOCiiHgr8IkK5/4iIqZFxCHAZ4DvSTq2wnHnki1g+LaIODRd12zIcIIxG7y76Lmw4H+RlvqIbJXcqiLifrJE8ukKuyeQW/QwIh6EV2pBdyp7Jsojkn4gabe0b6akuyTdJ+lHaY26Us3kKyn+kKQ3p/g+km5LNar/S+U1rcwGxAnGbBDSEiXH0nOJoCeA06s1fVVwH/DmCvF/Bi5R9kC5L0naL7dvBvA54AiyhRSPT01bZwF/EdkCop1kiz+W/D7FLwI+n2JnA7+MbKHIxcCkGsts1qfdm10AsyGqTdL9ZA+7WkH2/A0kvZ1sqZ5pZI8h2EhWw3mCLBFUUrHWEBFL0tpas8kW1lwp6fC0e3lE/Dq950KyJYP+QPYQq19lS1jxqvTeJTemnyuA49P20aXtiLhZ0qbabt+sb67BmA3M1oiYSvYky1exsw/mL4A7I+IpsoUNLwP+F3BLVF+XaRrZg+J2EdkDpK6OiI+RLa5aepxB+bVKS7YvTX1DUyPi0Ig4JXfMS+nnDnr+cen1oqwQTjBmgxARz5F11H8+PTZhJXCcpL0i4jHgArLnf/xbpfMlvRX432TNYeX73iXpNWl7D7Ia0G/T7hlpFe/dgBOBX5I95fEoSQemc14j6eA+buFO4KPp+PeQPW7XrC7cRGY2SBGxUtIDwNyIuFLSvwF3S3oReBL4G+Ay7XzS4jslrSRbkfkZ4DMRcXuFS08nG2G2neyPwX+JiHslHUPW9HUeWR/MncCPI+JlSX8NLJQ0Jl3jLLLVvqv5Sjr+PuAOdiYws0HzaspmQ0xKMJ+PiFoHEZg1hZvIzMysEK7BmJlZIVyDMTOzQjjBmJlZIZxgzMysEE4wZmZWCCcYMzMrxP8Hu5DqajdwI8MAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.scatter(df['R&D Spend'], df['Profit'])\n", + "#plt.plot(X_train, regressor.predict(X_train), color = 'blue')\n", + "plt.title('R&D Spend vs Profit')\n", + "plt.xlabel('R&D Spend')\n", + "plt.ylabel('Profit')\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 128, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEWCAYAAABbgYH9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAqeUlEQVR4nO3de5xdZX3v8c/XJMZRhCQQMUyAxHKpKJo0U0oPhYNiSbQ9EjhYQlVipY1S6l2OifYliPUYpMqR4xGLhXJRISli4CgpRiPSWm4TAoQAMRGCTBIhkICgkZOE3/ljPZusGfbszGT22nutme/79dqvWfNbl3nWnpn1289lPUsRgZmZWbO9rN0FMDOz4ckJxszMCuEEY2ZmhXCCMTOzQjjBmJlZIZxgzMysEE4wVmmSrpD0D3u476cl/XOzty2CpKWS5rbr57eSpH+Q9KSkX0k6SNJzkka1u1w2ePJ9MFZGkm4B3gy8NiKeb7DdFUBPRPx9i4rWUCr3tyJij5ORpPOAQyLiPc0qV5EkHQ8sB34LBLARWBgR/7IHxzoQ+DlwcEQ8UWf9LQzx/bXWcQ3GSkfSFOBYsovVO9tbmuaSNLrdZSjIxojYC9gb+BTwTUlH9N1oAOd/MPBUveRi1eMEY2V0BnA7cAXQq1lI0nRJd0t6VtIi4BW5dcdL6pH0PyQ9IWmTpNmS3iHp55K2SPp0bvvzJH0rLU+RFJLmSvplaqL5TD/bvkLStyQ9JelpSXdJ2l/SF8gS49dSs87X0vYh6WxJa4G1KfZVSY9J+rWkFZKOTfFZwKeB09Ix7k3xWyT9dVp+maS/l/RoOs+rJO0zkPPo814enZqhRuViJ0u6Ly0fJak7lfFxSV/Z3S8uMkuArcARkt4n6WeSLpK0BThP0j6p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R8XnrGR22bD+ePlb5OknRret7H/ZKOlbQQ6Eixb0uaouw5Q18nu0nwQEmXpOeDrJb0uXSsD5PNK/cTST9JsfVKz22R9PH0M+6X9NEUqx37m+lYP5T04jmb7dae3j3tl1/D+QW8B7gsLf8n2RxyHwcuT7E3kU1G2ZW+D3Y9W+N7ZM/qGEM2ff09KX488P20fF467liyea+eAsakdc+lr58APpOWRwGvzq9Py1PI5s46OhebkNvnFuBN6fv19L7Dfn362TOAVcCrgL3Ipgmano69A5iWtl8MvKfdvxu/qvNyDcasvtOBa9Pyten748imFCEi7iOb/qfm/wH/lpZXAT+NbKLQVWQX6np+EBHPR9Zk9QSwf5/1dwF/Jek84MiIeLaf4zwaEbfnvv8LSXcDK8nmpTqiwXlCNuXI9yLiNxHxHNkEisemdY9ExD1peUWDczF7idHtLoBZ2UjaF3gr8EZJQVYTCLILdn+dltsjorbuBeB5gIh4Ic1OW8/zueWd9Pl/jIhbJR0H/BlwtaQLI+KqOsf5Ta7sU4FPAn8YEVslXUE2z1Qj9aZk76+MbiKzAXMNxuylTgWuioiDI2JKZM/beISsj+PdAJLeSNZMVhhJBwNPRMQ3yZ718Qdp1XZJY/rZbW+yhPOMpP2Bt+fWPQu8us4+twKzJb0yPRDvZLJZwM2GxDUYs5c6HVjYJ/Zdsn6JDkn3kc10fGfB5TgeOEfSduA54IwUvxS4LzWDfSa/Q0TcK2klWT/Kw8DPcqsvBZZK2hQRb8ntc3eq6dTO558jYqWkKc0/JRtJPEzZzMwK4SYyMzMrhBOMmZkVwgnGzMwK4QRjZmaFcIIxM7NCOMGYmVkhnGDMzKwQ/x/J+3ImvK9sZwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.scatter(df['Administration'], df['Profit'])\n", + "#plt.plot(X_train, regressor.predict(X_train), color = 'blue')\n", + "plt.title('Administration vs Profit')\n", + "plt.xlabel('Administration')\n", + "plt.ylabel('Profit')\n", + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 129, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Text(0.5, 0, 'State')" + ] + }, + "execution_count": 129, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAmkAAAFyCAYAAACuiE0XAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAApo0lEQVR4nO3de7gkdX3n8feHGRxR7jCwMIMMBuIKGDUQxKjxgisYL7BZzA5PDIOyITFuRKOJkJgFNURNoii6YjAQwKhAWI0YQ5SASlRAByUiIDIBZEYQBhkRUDDgd/+o35E+h3OZcxm65sz79Tz9nO5f1a/629XVpz/9q6ruVBWSJEnql82GXYAkSZIeyZAmSZLUQ4Y0SZKkHjKkSZIk9ZAhTZIkqYcMaZIkST1kSJMeRUmelOQbSe5J8rokH0ryZ9Pov0WSTye5O8k/bKAaK8me7fqo+pK8JsntSe5NskOSZyW5od0+bEPUI0iyrD0vC4ddC0CSo5J8adh1SPOdIU1zLskXkqxLsmjYtfTQHwNfqKqtquqUqvq9qno7QJLnJVkzRf/DgZ2BHarqFRu62DH1bQ68B3hRVW1ZVT8A3gZ8oN3+xw1dz6AkZyb580ej76YcSoYVEOfqfpPcnOSFc1XXxsh1sPEypGlOJVkGPAco4OUbYPm9GEkYz3rWtjtwzSzuZnfgO1X14HQ7zsG62xl4LKPrn/Hj6fNzOZ9tKuvdx6l5oaq8eJmzC/B/gC/Tjbj8U2tbBPwQ2HdgvsXAT4Cd2u2XAle1+b4C/NLAvDcDbwa+CTwALASOA/4DuAe4FvjvA/MvAN4N3AncBPxvutC4sE3fBjgduA34HvDnwIIJHs+JwPnAue2+vg48dYraXk4XXH4IfAF4cpv3EuAh4H7gXuAXgTPb/T++rY+ftWn3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H3gM8N+r6vvDqk2SpPnEkKYZaV9eO3Js2jVVdckw65Ekab4xpEmSJPWQx6RJkiT1kCFNkiSphwxpkjZZSf40yTVJvpnkqiTPSPL6JI9bj77rNZ8kzZTHpEnaJCV5JvAe4HlV9UCSHenOUv4KsH9V3TlF/5vXZz5JmilH0iRtqnYB7qyqBwBa2Doc2BX4fJLPAyQ5NcnKNuL21tb2unHme1GSy5J8Pck/JNlyGA9K0vzhSJqkTVILUV8CHgf8K3BuVX1x7AhZku2r6q4kC4CLgddV1TcH52ujcJ8AXlxV9yV5M7Coqt42hIcmaZ7wZ6EkbZKq6t4k+wHPAZ4PnJvkuHFm/c0kx9D9v9wF2Bv45ph5DmztX04C3W7TyzZU7ZI2DYY0SZusqnoI+ALwhSRXAysGpyfZA3gT8CtVtS7JmYz/+7UBLqqqIzZsxZI2JR6TJmmTlORJSfYaaHoa8F3gHmCr1rY1cB9wd/tJtBcPzD843+XAs5Ls2Zb9uCS/uAHLl7QJcCRN0qZqS+D9SbYFHgRWAccARwAXJrmtqp6f5BvANcCNwJcH+p82Zr6jgI8nWdSmvwX4zqPzUCTNR544IEmS1EPu7pQkSeohQ5okSVIPGdIkSZJ6yJAmSZLUQ4Y0SZKkHjKkSZIk9ZAhTZIkqYf+P3DSH2lqNt/4AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "ax = df.groupby(['State'])['Profit'].mean().plot.bar(\n", + " figsize = (10,5))\n", + "ax.set_title(\"Average profit for different states where the startups operate\")\n", + "\n", + "ax.set_xlabel(\"State\")\n", + "ax.set_xlabel(\"State\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 130, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "New York 17\n", + "California 17\n", + "Florida 16\n", + "Name: State, dtype: int64" + ] + }, + "execution_count": 130, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.State.value_counts()" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "metadata": {}, + "outputs": [], + "source": [ + "df['NewYork_State'] = np.where(df['State']=='New York',1,0)\n", + "df['California_State'] = np.where(df['State']=='California',1,0)\n", + "df['Florida_State'] = np.where(df['State']=='Florida',1,0)\n", + "\n", + "df.drop(columns=['State'],axis=1,inplace=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
R&D SpendAdministrationMarketing SpendProfitNewYork_StateCalifornia_StateFlorida_State
0165349.20136897.80471784.10192261.83100
1162597.70151377.59443898.53191792.06010
2153441.51101145.55407934.54191050.39001
3144372.41118671.85383199.62182901.99100
4142107.3491391.77366168.42166187.94001
\n", + "
" + ], + "text/plain": [ + " R&D Spend Administration Marketing Spend Profit NewYork_State \\\n", + "0 165349.20 136897.80 471784.10 192261.83 1 \n", + "1 162597.70 151377.59 443898.53 191792.06 0 \n", + "2 153441.51 101145.55 407934.54 191050.39 0 \n", + "3 144372.41 118671.85 383199.62 182901.99 1 \n", + "4 142107.34 91391.77 366168.42 166187.94 0 \n", + "\n", + " California_State Florida_State \n", + "0 0 0 \n", + "1 1 0 \n", + "2 0 1 \n", + "3 0 0 \n", + "4 0 1 " + ] + }, + "execution_count": 132, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "metadata": {}, + "outputs": [], + "source": [ + "dependent_variable = 'Profit'" + ] + }, + { + "cell_type": "code", + "execution_count": 134, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['R&D Spend',\n", + " 'Administration',\n", + " 'Marketing Spend',\n", + " 'NewYork_State',\n", + " 'California_State',\n", + " 'Florida_State']" + ] + }, + "execution_count": 134, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "independent_variables = df.columns.tolist()\n", + "independent_variables.remove(dependent_variable)\n", + "independent_variables" + ] + }, + { + "cell_type": "code", + "execution_count": 135, + "metadata": {}, + "outputs": [], + "source": [ + "X = df[independent_variables].values\n", + "y = df[dependent_variable].values" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[1.6534920e+05 1.3689780e+05 4.7178410e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.6259770e+05 1.5137759e+05 4.4389853e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.5344151e+05 1.0114555e+05 4.0793454e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [1.4437241e+05 1.1867185e+05 3.8319962e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.4210734e+05 9.1391770e+04 3.6616842e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [1.3187690e+05 9.9814710e+04 3.6286136e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.3461546e+05 1.4719887e+05 1.2771682e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.3029813e+05 1.4553006e+05 3.2387668e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [1.2054252e+05 1.4871895e+05 3.1161329e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.2333488e+05 1.0867917e+05 3.0498162e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.0191308e+05 1.1059411e+05 2.2916095e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [1.0067196e+05 9.1790610e+04 2.4974455e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [9.3863750e+04 1.2732038e+05 2.4983944e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [9.1992390e+04 1.3549507e+05 2.5266493e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.1994324e+05 1.5654742e+05 2.5651292e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [1.1452361e+05 1.2261684e+05 2.6177623e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [7.8013110e+04 1.2159755e+05 2.6434606e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [9.4657160e+04 1.4507758e+05 2.8257431e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [9.1749160e+04 1.1417579e+05 2.9491957e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [8.6419700e+04 1.5351411e+05 0.0000000e+00 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [7.6253860e+04 1.1386730e+05 2.9866447e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [7.8389470e+04 1.5377343e+05 2.9973729e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [7.3994560e+04 1.2278275e+05 3.0331926e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [6.7532530e+04 1.0575103e+05 3.0476873e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [7.7044010e+04 9.9281340e+04 1.4057481e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [6.4664710e+04 1.3955316e+05 1.3796262e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [7.5328870e+04 1.4413598e+05 1.3405007e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [7.2107600e+04 1.2786455e+05 3.5318381e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [6.6051520e+04 1.8264556e+05 1.1814820e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [6.5605480e+04 1.5303206e+05 1.0713838e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [6.1994480e+04 1.1564128e+05 9.1131240e+04 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [6.1136380e+04 1.5270192e+05 8.8218230e+04 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [6.3408860e+04 1.2921961e+05 4.6085250e+04 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [5.5493950e+04 1.0305749e+05 2.1463481e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [4.6426070e+04 1.5769392e+05 2.1079767e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [4.6014020e+04 8.5047440e+04 2.0551764e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [2.8663760e+04 1.2705621e+05 2.0112682e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [4.4069950e+04 5.1283140e+04 1.9702942e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [2.0229590e+04 6.5947930e+04 1.8526510e+05 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [3.8558510e+04 8.2982090e+04 1.7499930e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [2.8754330e+04 1.1854605e+05 1.7279567e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [2.7892920e+04 8.4710770e+04 1.6447071e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [2.3640930e+04 9.6189630e+04 1.4800111e+05 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.5505730e+04 1.2738230e+05 3.5534170e+04 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [2.2177740e+04 1.5480614e+05 2.8334720e+04 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.0002300e+03 1.2415304e+05 1.9039300e+03 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [1.3154600e+03 1.1581621e+05 2.9711446e+05 0.0000000e+00 0.0000000e+00\n", + " 1.0000000e+00]\n", + " [0.0000000e+00 1.3542692e+05 0.0000000e+00 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]\n", + " [5.4205000e+02 5.1743150e+04 0.0000000e+00 1.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00]\n", + " [0.0000000e+00 1.1698380e+05 4.5173060e+04 0.0000000e+00 1.0000000e+00\n", + " 0.0000000e+00]]\n", + "[192261.83 191792.06 191050.39 182901.99 166187.94 156991.12 156122.51\n", + " 155752.6 152211.77 149759.96 146121.95 144259.4 141585.52 134307.35\n", + " 132602.65 129917.04 126992.93 125370.37 124266.9 122776.86 118474.03\n", + " 111313.02 110352.25 108733.99 108552.04 107404.34 105733.54 105008.31\n", + " 103282.38 101004.64 99937.59 97483.56 97427.84 96778.92 96712.8\n", + " 96479.51 90708.19 89949.14 81229.06 81005.76 78239.91 77798.83\n", + " 71498.49 69758.98 65200.33 64926.08 49490.75 42559.73 35673.41\n", + " 14681.4 ]\n" + ] + } + ], + "source": [ + "print(X)\n", + "print(y)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Splitting the dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 137, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.model_selection import train_test_split\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 1/3, random_state = 0)" + ] + }, + { + "cell_type": "code", + "execution_count": 138, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.00327821, 0.00444355, 0. , 1. , 0. ,\n", + " 0. ],\n", + " [0.39676926, 0.98286294, 0.22709197, 1. , 0. ,\n", + " 0. ],\n", + " [0.69261666, 0.68906137, 0.55486446, 1. , 0. ,\n", + " 0. ],\n", + " [0.37493063, 0.62167963, 0.19316302, 0. , 0. ,\n", + " 1. ]])" + ] + }, + "execution_count": 138, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from sklearn.preprocessing import MinMaxScaler\n", + "sc = MinMaxScaler()\n", + "X_train = sc.fit_transform(X_train)\n", + "X_test = sc.transform(X_test)\n", + "#print(X_train)\n", + "#print(X_test)\n", + "X_train[1:5]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Multiple Linear Regression Model" + ] + }, + { + "cell_type": "code", + "execution_count": 139, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "LinearRegression()" + ] + }, + "execution_count": 139, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from sklearn.linear_model import LinearRegression\n", + "regressor = LinearRegression()\n", + "regressor.fit(X_train, y_train)" + ] + }, + { + "cell_type": "code", + "execution_count": 140, + "metadata": {}, + "outputs": [], + "source": [ + "y_pred = regressor.predict(X_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 141, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "102" + ] + }, + "execution_count": 141, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "X_test.size\n" + ] + }, + { + "cell_type": "code", + "execution_count": 142, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "17" + ] + }, + "execution_count": 142, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_pred.size" + ] + }, + { + "cell_type": "code", + "execution_count": 143, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "198" + ] + }, + "execution_count": 143, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "X_train.size\n" + ] + }, + { + "cell_type": "code", + "execution_count": 144, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "33" + ] + }, + "execution_count": 144, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_train.size" + ] + }, + { + "cell_type": "code", + "execution_count": 145, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "17" + ] + }, + "execution_count": 145, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_test.size" + ] + }, + { + "cell_type": "code", + "execution_count": 146, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.39946683, 1.26892014, 0.25042853, 0. , 0. ,\n", + " 1. ],\n", + " [0.60884455, 0.39128957, 0.52936195, 0. , 1. ,\n", + " 0. ],\n", + " [0.61635061, 0.57292553, 0.48573267, 0. , 0. ,\n", + " 1. ],\n", + " [0.16869099, 0.32290051, 0.34861436, 0. , 0. ,\n", + " 1. ],\n", + " [0.92798459, 0.48165538, 0.8646636 , 0. , 0. ,\n", + " 1. ],\n", + " [0.43609283, 0.73975262, 0.74861321, 1. , 0. ,\n", + " 0. ],\n", + " [0.12234465, 0.14165731, 0.39269043, 1. , 0. ,\n", + " 0. ],\n", + " [0.36974101, 0.97967389, 0.18698856, 1. , 0. ,\n", + " 0. ],\n", + " [0.4475048 , 0.69066401, 0.64291963, 0. , 0. ,\n", + " 1. ],\n", + " [0.85943772, 0.3874369 , 0.77613557, 0. , 0. ,\n", + " 1. ],\n", + " [0.33561668, 0.50012413, 0.45494286, 0. , 0. ,\n", + " 1. ],\n", + " [0.2782839 , 0.32615264, 0.43561799, 1. , 0. ,\n", + " 0. ],\n", + " [0.45557444, 0.89692957, 0.28413435, 0. , 0. ,\n", + " 1. ],\n", + " [0.2807759 , 1.02789506, 0.44680961, 0. , 1. ,\n", + " 0. ],\n", + " [0.55488118, 0.60752345, 0.62511553, 0. , 0. ,\n", + " 1. ],\n", + " [0.7880179 , 0.91039595, 0.68649342, 0. , 0. ,\n", + " 1. ],\n", + " [0.72539353, 1.01682022, 0.54370828, 0. , 0. ,\n", + " 1. ]])" + ] + }, + "execution_count": 146, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "X_test" + ] + }, + { + "cell_type": "code", + "execution_count": 147, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([111616.64259451, 132709.39466316, 140155.11033793, 76099.20398184,\n", + " 186329.94240372, 112822.19807255, 63002.00394804, 99107.10428091,\n", + " 119287.75473383, 175522.83864739, 101000.698615 , 85772.99293235,\n", + " 117713.76481525, 90230.88085201, 133375.04389452, 167530.54765828,\n", + " 158013.54602063])" + ] + }, + "execution_count": 147, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_pred" + ] + }, + { + "cell_type": "code", + "execution_count": 148, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([103282.38, 144259.4 , 146121.95, 77798.83, 191050.39, 105008.31,\n", + " 81229.06, 97483.56, 110352.25, 166187.94, 96778.92, 96479.51,\n", + " 105733.54, 96712.8 , 124266.9 , 155752.6 , 132602.65])" + ] + }, + "execution_count": 148, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_test" + ] + }, + { + "cell_type": "code", + "execution_count": 149, + "metadata": {}, + "outputs": [], + "source": [ + "#regressor.predict([[165349.20],[136897.80],[471784.10],[1,0,0]])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "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.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/Amrin_ML.md b/Amrin_ML.md new file mode 100644 index 000000000..1c61a7f6a --- /dev/null +++ b/Amrin_ML.md @@ -0,0 +1,9 @@ +From this module we have learned : + + What is Machine Learning ? + Different types of Machine Learning. Pros and Cons + What is Regression and Classification? Difference between them. + Types of Regression. Linear VS Logistic Regression. + Types of Classification.Classification Problem Evaluation Metrics + What is Clustering? K-Means and Hierchichal Clustering theory and algorithm. + Assignment : Concrete Compressive Strength Prediction using Machine Learning (Linera Regression)