├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Calculus_with_Python1.ipynb ├── Code ├── Day 11 K-NN.md ├── Day 13 SVM.md ├── Day 1_Data PreProcessing.md ├── Day 25 Decision Tree.md ├── Day 34 Random_Forest.md ├── Day 6 Logistic Regression.md ├── Day2_Simple_Linear_Regression.md └── Day3_Multiple_Linear_Regression.md ├── Day_N.ipynb ├── Info-graphs ├── Day 1.jpg ├── Day 12.jpg ├── Day 2.jpg ├── Day 23.jpg ├── Day 3.jpg ├── Day 33.jpg ├── Day 4.jpg ├── Day 43.jpg ├── Day 54.jpg ├── Day 7.jpg └── readme.md ├── LICENSE ├── Other Docs ├── data.PNG ├── ets.png ├── readme.md ├── test.png ├── testing.png └── training.png ├── PULL_REQUEST_TEMPLATE.md ├── Python_Simulation_ML.ipynb ├── README.md ├── _config.yml ├── datasets ├── 50_Startups.csv ├── Data.csv ├── Social_Network_Ads.csv ├── readme.md └── studentscores.csv └── index.py /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pxd text diff=python 2 | *.py text diff=python 3 | *.py3 text diff=python 4 | *.pyw text diff=python 5 | *.pyx text diff=python 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Desktop (please complete the following information):** 24 | - OS: [e.g. iOS] 25 | - Browser [e.g. chrome, safari] 26 | - Version [e.g. 22] 27 | 28 | **Smartphone (please complete the following information):** 29 | - Device: [e.g. iPhone6] 30 | - OS: [e.g. iOS8.1] 31 | - Browser [e.g. stock browser, safari] 32 | - Version [e.g. 22] 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at avikjain02@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. 3 | 4 | Please note we have a code of conduct, please follow it in all your interactions with the project. 5 | -------------------------------------------------------------------------------- /Calculus_with_Python1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Calculus_with_Python1.ipynb", 7 | "provenance": [], 8 | "authorship_tag": "ABX9TyONR7niwo8Xto2Vd58ErdfA", 9 | "include_colab_link": true 10 | }, 11 | "kernelspec": { 12 | "name": "python3", 13 | "display_name": "Python 3" 14 | } 15 | }, 16 | "cells": [ 17 | { 18 | "cell_type": "markdown", 19 | "metadata": { 20 | "id": "view-in-github", 21 | "colab_type": "text" 22 | }, 23 | "source": [ 24 | "\"Open" 25 | ] 26 | }, 27 | { 28 | "cell_type": "markdown", 29 | "metadata": { 30 | "id": "NLGZ6TldL8Tw", 31 | "colab_type": "text" 32 | }, 33 | "source": [ 34 | "#Chapter 1: Solving ODEs" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "metadata": { 40 | "id": "u-XGpTNrLx-U", 41 | "colab_type": "code", 42 | "colab": {} 43 | }, 44 | "source": [ 45 | "import numpy as np\n", 46 | "import matplotlib.pyplot as plt\n", 47 | "\n", 48 | "from scipy.integrate import odeint\n", 49 | "\n", 50 | "%matplotlib inline" 51 | ], 52 | "execution_count": 1, 53 | "outputs": [] 54 | }, 55 | { 56 | "cell_type": "markdown", 57 | "metadata": { 58 | "id": "iNAaWZ2GMRUp", 59 | "colab_type": "text" 60 | }, 61 | "source": [ 62 | "#Problem 1. \n", 63 | "\n", 64 | "$ \\frac {dy} {dx} = -ky$\n" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "metadata": { 70 | "id": "etCghE3EMJDe", 71 | "colab_type": "code", 72 | "colab": {} 73 | }, 74 | "source": [ 75 | "#1. Model creation\n", 76 | "\n", 77 | "def model(y,x):\n", 78 | " k = 0.5\n", 79 | " dydx = -k*y\n", 80 | " return dydx\n", 81 | "\n", 82 | "#2. x \n", 83 | "x = np.linspace(0,10,20)\n", 84 | "\n", 85 | "# 3. Intital value\n", 86 | "y0 = 5\n", 87 | "\n", 88 | "#solution\n", 89 | "y = odeint(model,y0,x)" 90 | ], 91 | "execution_count": 5, 92 | "outputs": [] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "metadata": { 97 | "id": "69txj8DFPXlR", 98 | "colab_type": "code", 99 | "colab": { 100 | "base_uri": "https://localhost:8080/", 101 | "height": 282 102 | }, 103 | "outputId": "dcb66432-4066-4bdd-e143-cb9653f82b08" 104 | }, 105 | "source": [ 106 | "plt.plot(x,y)" 107 | ], 108 | "execution_count": 6, 109 | "outputs": [ 110 | { 111 | "output_type": "execute_result", 112 | "data": { 113 | "text/plain": [ 114 | "[]" 115 | ] 116 | }, 117 | "metadata": { 118 | "tags": [] 119 | }, 120 | "execution_count": 6 121 | }, 122 | { 123 | "output_type": "display_data", 124 | "data": { 125 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAdEklEQVR4nO3deXxUd73/8ddnJpNlEkiAhCUkEPaWJUChllK6WFsLtoV6rbU/pVf9VXu9Wlu9erV6r9ft+rN6/bnX3i5Wr9pq721rS5FqF6BA7QJlX8sOCYEkQEhCtsnM9/4xgUJlmcBMzizv5+Mxj5w5M0zew/LOl++cc77mnENERJKXz+sAIiJyZipqEZEkp6IWEUlyKmoRkSSnohYRSXJZiXjR4uJiV1FRkYiXFhFJS2+++Wa9c67kVI8lpKgrKipYsWJFIl5aRCQtmdnu0z2mqQ8RkSSnohYRSXIqahGRJKeiFhFJcipqEZEkF9NRH2a2C2gCwkCnc25qIkOJiMjbunN43rudc/UJSyIiIqeUNFMfbaEwDy7Zzl+36WeBiMiJYi1qBzxvZm+a2R2neoKZ3WFmK8xsRV1dXbeDBPw+Hlq6k9+8etpjvkVEMlKsRT3DOXcRMAv4jJld8c4nOOcedM5Ndc5NLSk55VmQZ+T3GddPGMTCLbU0toW6/etFRNJVTEXtnKvu+loL/BF4VyLCzJ5USkdnhOc3HEjEy4uIpKSzFrWZ5ZtZr2PbwHuB9YkIM7m8iPK+ecxbsy8RLy8ikpJiGVEPAJaZ2RrgDeBPzrk/JyKMmXFjZSmvbKvnYHN7Ir6FiEjKOWtRO+d2OOcmdt3GOee+k8hAsyeVEo44FqyrSeS3ERFJGUlzeN4xFwzszegBBZr+EBHpknRFDTB7YinLdx2muqHV6ygiIp5LyqK+cWIpAPM1qhYRSc6iHtovn0nlRZr+E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4H7n3GTgKHH673Cy6pqXnUP0h1QpkG9mc71N1fNc9NjnuBz/nCxFnZHrMppZgGhJP+qce8rrPD3gMmC2me0iOr11tZn9zttICVcFVDnnjv1v6QmixZ3OrgF2OufqnHMh4ClguseZesoBMxsE0PW1Nh4vmixFnXHrMpqZEZ233OSc+6HXeXqCc+4rzrky51wF0T/jhc65tB5pOef2A3vNbEzXrvcAGz2M1BP2ANPMLNj19/w9pPkHqCeYB3y0a/ujwDPxeNGYluJKtAxdl/Ey4DZgnZmt7tr31a5lzyS9fBZ4tGsQsgP4uMd5Eso597qZPQGsJHp00yrS8HRyM/s9cBVQbGZVwNeBe4H/NrPbiV7q+Za4fC+dQi4iktySZepDREROQ0UtIpLkVNQiIklORS0ikuRU1CIiSU5FLSKS5FTUIiJJ7n8BR6sbKg+ZMFAAAAAASUVORK5CYII=\n", 126 | "text/plain": [ 127 | "
" 128 | ] 129 | }, 130 | "metadata": { 131 | "tags": [], 132 | "needs_background": "light" 133 | } 134 | } 135 | ] 136 | }, 137 | { 138 | "cell_type": "markdown", 139 | "metadata": { 140 | "id": "-xcr2yRRQDcE", 141 | "colab_type": "text" 142 | }, 143 | "source": [ 144 | "#Problem 2. \n", 145 | "\n", 146 | "$5\\frac {dy(t)}{dt} = -y(t) + u(t) $" 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "metadata": { 152 | "id": "9gE21EwQPd2U", 153 | "colab_type": "code", 154 | "colab": { 155 | "base_uri": "https://localhost:8080/", 156 | "height": 282 157 | }, 158 | "outputId": "4c717fa2-de52-49e8-970b-eadc2ee0e4df" 159 | }, 160 | "source": [ 161 | "def model(y,t):\n", 162 | " if t<=10:\n", 163 | " u = 0\n", 164 | " else:\n", 165 | " u = 10\n", 166 | " dydt = (-y + u)/5.0\n", 167 | " return dydt\n", 168 | "\n", 169 | "t = np.linspace(0,100,100)\n", 170 | "\n", 171 | "y0 = 10\n", 172 | "\n", 173 | "y = odeint(model,y0,t)\n", 174 | "\n", 175 | "plt.plot(t,y)\n", 176 | "\n", 177 | "\n" 178 | ], 179 | "execution_count": 7, 180 | "outputs": [ 181 | { 182 | "output_type": "execute_result", 183 | "data": { 184 | "text/plain": [ 185 | "[]" 186 | ] 187 | }, 188 | "metadata": { 189 | "tags": [] 190 | }, 191 | "execution_count": 7 192 | }, 193 | { 194 | "output_type": "display_data", 195 | "data": { 196 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAdEUlEQVR4nO3deZCcd33n8fe3r5npuW9Jo5FGWEKyZPCBMMJOso7Nci8OKXYLap04We96qVCEUFRx1NYWtbtVqT2yBFJFkfKa0wGTjW2Cw0ISMDgQMLYl29iWZFsanaPRaE7N0TPTPd392z+6W0iyxpKmj+foz6tqqqef6enn23rsj376Pr/f85hzDhERCZ6I1wWIiMjaKMBFRAJKAS4iElAKcBGRgFKAi4gEVKyWO+vp6XFDQ0O13KWISODt27dv0jnXe/H2mgb40NAQe/fureUuRUQCz8yOX2q7WigiIgGlABcRCSgFuIhIQCnARUQCSgEuIhJQlw1wM/uKmY2b2Yvnbesysx+a2aHiY2d1yxQRkYtdyQj8a8A7L9r2aeAx59w24LHicxERqaHLzgN3zv3UzIYu2nwncFvx+68DjwOfqmBdF/jOsyOk0jnu2rO5WrsQH3DOkc7mSWfzZLJ5Mrk8K9k8K7nC99mcI5svPRa+8sXHXD5PLg8553DOkXeOXB7y554Xvs+7wn5c8THvwHHeNkqPpZoK20rfn1/rq7Zd8FnO337pSzZf7ZWcPb3wsy47Xba7bxmiu6Whou+51oU8/c6508Xvx4D+1V5oZvcC9wJs2rRpTTv7f8+PcerskgLc51LpLBPzaSYX0kynMswsZji7uMLs0gpzyyvMLWVZSBe+FjNZ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YpgUhwOuGmbUADwN/4pybO/9nrjDfMzRzPs3svcC4c26f17XUUAy4CfiSc+5GIMVF7ZIQHudOCiPOLcAGoJlXtxpCr1rHNQgBfgoYPO/5xuK2UDGzOIXw/qZz7pHi5jOlf1oVH8e9qq8KbgXeZ2bHKLTFbqfQH+4o/lMbwnesR4AR59yTxecPUQj0MB/ntwFHnXMTzrkV4BEKxz7Mx7lkteNasUwLQoA/DWwrnrVOUDgB8qjHNVVUsff7ZeCgc+5z5/3oUeDu4vd3A9+tdW3V4pz7jHNuo3NuiMIx/bFz7t8CPwE+UHxZ2D7zGHDSzLYXN90BHCDEx5lC62SPmSWL/52XPnNoj/N5VjuujwK/X5yNsgeYPa/VcnWcc77/At4NvAIMA//J63qq8Pl+g8I/r54Hnit+vZtCT/gx4BDwI6DL61qr9PlvA75X/P51wFPAYeBvgAav66vwZ70B2Fs81n8LdIb9OAP/BXgJeBF4AGgI23EGHqTQ41+h8C+te1Y7roBRmFk3DLxAYYbOmvarpfQiIgEVhBaKiIhcggJcRCSgFOAiIgGlABcRCSgFuIhIQCnARUQCSgEuIhJQ/x+XgWma4/yvtgAAAABJRU5ErkJggg==\n", 197 | "text/plain": [ 198 | "
" 199 | ] 200 | }, 201 | "metadata": { 202 | "tags": [], 203 | "needs_background": "light" 204 | } 205 | } 206 | ] 207 | }, 208 | { 209 | "cell_type": "markdown", 210 | "metadata": { 211 | "id": "3MCikz32RUMu", 212 | "colab_type": "text" 213 | }, 214 | "source": [ 215 | "#The Soul concept : isolate the derivative on the LHS | everything else RHS" 216 | ] 217 | }, 218 | { 219 | "cell_type": "code", 220 | "metadata": { 221 | "id": "tFJPTLPRQ2tN", 222 | "colab_type": "code", 223 | "colab": {} 224 | }, 225 | "source": [ 226 | "#######" 227 | ], 228 | "execution_count": 8, 229 | "outputs": [] 230 | }, 231 | { 232 | "cell_type": "markdown", 233 | "metadata": { 234 | "id": "OFe3ZRfkRryS", 235 | "colab_type": "text" 236 | }, 237 | "source": [ 238 | "#Problem 3. Two ODEs together. \n", 239 | "\n", 240 | "$\\frac{dx(t)}{dt} = - 3exp(-t)$\n", 241 | "\n", 242 | "$\\frac{dy(t)}{dt} = 3 - y(t)$" 243 | ] 244 | }, 245 | { 246 | "cell_type": "code", 247 | "metadata": { 248 | "id": "clNxbHeORqB9", 249 | "colab_type": "code", 250 | "colab": {} 251 | }, 252 | "source": [ 253 | "#the outputs of x and y will be stored in a two sized array. \n", 254 | "\n", 255 | "def modell(z,t):\n", 256 | " x = z[0]\n", 257 | " y = z[1]\n", 258 | " dxdt = 3.0*np.exp(-t)\n", 259 | " dydt = 3.0 - y\n", 260 | " return [dxdt,dydt]\n", 261 | "\n", 262 | "z0 = [0,0]\n", 263 | "\n", 264 | "t = np.linspace(0,10)\n", 265 | "\n", 266 | "z = odeint(modell,z0,t)" 267 | ], 268 | "execution_count": 19, 269 | "outputs": [] 270 | }, 271 | { 272 | "cell_type": "code", 273 | "metadata": { 274 | "id": "LikhMrH9Wl9p", 275 | "colab_type": "code", 276 | "colab": {} 277 | }, 278 | "source": [ 279 | "# print(z) #hence z is a 2D array" 280 | ], 281 | "execution_count": 17, 282 | "outputs": [] 283 | }, 284 | { 285 | "cell_type": "code", 286 | "metadata": { 287 | "id": "Vk44oqwCV_uO", 288 | "colab_type": "code", 289 | "colab": { 290 | "base_uri": "https://localhost:8080/", 291 | "height": 282 292 | }, 293 | "outputId": "106c1e49-7453-4898-a317-13b56fe73cc7" 294 | }, 295 | "source": [ 296 | "plt.plot(t,z[:,0],label = 'Solution for x(t)')\n", 297 | "plt.plot(t,z[:,1],label = 'Solution for y(t)')\n", 298 | "\n", 299 | "plt.legend()\n" 300 | ], 301 | "execution_count": 20, 302 | "outputs": [ 303 | { 304 | "output_type": "execute_result", 305 | "data": { 306 | "text/plain": [ 307 | "" 308 | ] 309 | }, 310 | "metadata": { 311 | "tags": [] 312 | }, 313 | "execution_count": 20 314 | }, 315 | { 316 | "output_type": "display_data", 317 | "data": { 318 | "image/png": "iVBOR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EDzU9ZWZpXodqL865HcBDwDagFKh0zv3V21QdqrdzrjT8uAzoHY2VxlqhJywzSwdeBu50zh3wOk97MbNLgN3OuaVeZ+lgScAk4HHn3ETgEHF856/wMePpNP4i6wekmdk13qbyRvh2nVG5fjzWCj2SG1bHHTML0Fjmc51zr3idp52dBUwzs600HlL7hpn9ydtIHaIEKHHOHfnf1zwaCz5efRPY4pwrd87VA68AZ3qcqSPtMrO+AOHvu6Ox0lgr9EhuWB1XzMxoPK661jn3sNd52ptz7qfOuQHOuTwaf74fOOfifs/NOVcGbDezEeFJ5wNrPIzU3rYBp5tZ1/Df8fOJ45PAzZgPzAw/ngm8Ho2VxtQt6JxzQTM7csNqPzDbObfa41jt7SzgWmCVmRWFp/3MOfeWh5mkffwLMDe8s/IFcL3HedqNc26xmc0DltF4Jddy4nQIADN7HpgKZJtZCfBzYBbwopndSOMw4v8UlW3po/8iIvEh1g65iIhIC1ToIiJxQoUuIhInVOgiInFChS4iEidU6CIicUKFLiISJ/4/LwF1RG5zNWgAAAAASUVORK5CYII=\n", 319 | "text/plain": [ 320 | "
" 321 | ] 322 | }, 323 | "metadata": { 324 | "tags": [], 325 | "needs_background": "light" 326 | } 327 | } 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "metadata": { 333 | "id": "LnFmYKs5Wb3K", 334 | "colab_type": "code", 335 | "colab": {} 336 | }, 337 | "source": [ 338 | "" 339 | ], 340 | "execution_count": null, 341 | "outputs": [] 342 | } 343 | ] 344 | } -------------------------------------------------------------------------------- /Code/Day 11 K-NN.md: -------------------------------------------------------------------------------- 1 | # K-Nearest Neighbors (K-NN) 2 | 3 |

4 | 5 |

6 | 7 | ## The DataSet | Social Network 8 | 9 |

10 | 11 |

12 | 13 | 14 | ## Importing the libraries 15 | ```python 16 | import numpy as np 17 | import matplotlib.pyplot as plt 18 | import pandas as pd 19 | ``` 20 | 21 | ## Importing the dataset 22 | ```python 23 | dataset = pd.read_csv('Social_Network_Ads.csv') 24 | X = dataset.iloc[:, [2, 3]].values 25 | y = dataset.iloc[:, 4].values 26 | ``` 27 | 28 | ## Splitting the dataset into the Training set and Test set 29 | ```python 30 | from sklearn.cross_validation import train_test_split 31 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0) 32 | ``` 33 | ## Feature Scaling 34 | ```python 35 | from sklearn.preprocessing import StandardScaler 36 | sc = StandardScaler() 37 | X_train = sc.fit_transform(X_train) 38 | X_test = sc.transform(X_test) 39 | ``` 40 | ## Fitting K-NN to the Training set 41 | ```python 42 | from sklearn.neighbors import KNeighborsClassifier 43 | classifier = KNeighborsClassifier(n_neighbors = 5, metric = 'minkowski', p = 2) 44 | classifier.fit(X_train, y_train) 45 | ``` 46 | ## Predicting the Test set results 47 | ```python 48 | y_pred = classifier.predict(X_test) 49 | ``` 50 | 51 | ## Making the Confusion Matrix 52 | ```python 53 | from sklearn.metrics import confusion_matrix 54 | cm = confusion_matrix(y_test, y_pred) 55 | ``` 56 | -------------------------------------------------------------------------------- /Code/Day 13 SVM.md: -------------------------------------------------------------------------------- 1 | # Day 13 | Support Vector Machine (SVM) 2 | 3 | ## Importing the libraries 4 | ```python 5 | import numpy as np 6 | import matplotlib.pyplot as plt 7 | import pandas as pd 8 | ``` 9 | 10 | ## Importing the dataset 11 | ```python 12 | dataset = pd.read_csv('Social_Network_Ads.csv') 13 | X = dataset.iloc[:, [2, 3]].values 14 | y = dataset.iloc[:, 4].values 15 | ``` 16 | 17 | ## Splitting the dataset into the Training set and Test set 18 | ```python 19 | from sklearn.cross_validation import train_test_split 20 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0) 21 | ``` 22 | 23 | ## Feature Scaling 24 | ```python 25 | from sklearn.preprocessing import StandardScaler 26 | sc = StandardScaler() 27 | X_train = sc.fit_transform(X_train) 28 | X_test = sc.fit_transform(X_test) 29 | ``` 30 | 31 | ## Fitting SVM to the Training set 32 | ```python 33 | from sklearn.svm import SVC 34 | classifier = SVC(kernel = 'linear', random_state = 0) 35 | classifier.fit(X_train, y_train) 36 | ``` 37 | ## Predicting the Test set results 38 | ```python 39 | y_pred = classifier.predict(X_test) 40 | ``` 41 | 42 | ## Making the Confusion Matrix 43 | ```python 44 | from sklearn.metrics import confusion_matrix 45 | cm = confusion_matrix(y_test, y_pred) 46 | ``` 47 | 48 | ## Visualising the Training set results 49 | 50 | ```python 51 | from matplotlib.colors import ListedColormap 52 | X_set, y_set = X_train, y_train 53 | X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), 54 | np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) 55 | plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), 56 | alpha = 0.75, cmap = ListedColormap(('red', 'green'))) 57 | plt.xlim(X1.min(), X1.max()) 58 | plt.ylim(X2.min(), X2.max()) 59 | for i, j in enumerate(np.unique(y_set)): 60 | plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], 61 | c = ListedColormap(('red', 'green'))(i), label = j) 62 | plt.title('SVM (Training set)') 63 | plt.xlabel('Age') 64 | plt.ylabel('Estimated Salary') 65 | plt.legend() 66 | plt.show() 67 | ``` 68 |

69 | 70 |

71 | 72 | ## Visualising the Test set results 73 | ```python 74 | from matplotlib.colors import ListedColormap 75 | X_set, y_set = X_test, y_test 76 | X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), 77 | np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) 78 | plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), 79 | alpha = 0.75, cmap = ListedColormap(('red', 'green'))) 80 | plt.xlim(X1.min(), X1.max()) 81 | plt.ylim(X2.min(), X2.max()) 82 | for i, j in enumerate(np.unique(y_set)): 83 | plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], 84 | c = ListedColormap(('red', 'green'))(i), label = j) 85 | plt.title('SVM (Test set)') 86 | plt.xlabel('Age') 87 | plt.ylabel('Estimated Salary') 88 | plt.legend() 89 | plt.show() 90 | ``` 91 |

92 | 93 |

94 | -------------------------------------------------------------------------------- /Code/Day 1_Data PreProcessing.md: -------------------------------------------------------------------------------- 1 | # Data PreProcessing 2 |

3 | 4 |

5 | 6 | As shown in the infograph we will break down data preprocessing in 6 essential steps. 7 | Get the dataset from [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/tree/master/datasets) that is used in this example 8 | 9 | ## Step 1: Importing the libraries 10 | ```Python 11 | import numpy as np 12 | import pandas as pd 13 | ``` 14 | ## Step 2: Importing dataset 15 | ```python 16 | dataset = pd.read_csv('Data.csv') 17 | X = dataset.iloc[ : , :-1].values 18 | Y = dataset.iloc[ : , 3].values 19 | ``` 20 | ## Step 3: Handling the missing data 21 | ```python 22 | from sklearn.preprocessing import Imputer 23 | imputer = Imputer(missing_values = "NaN", strategy = "mean", axis = 0) 24 | imputer = imputer.fit(X[ : , 1:3]) 25 | X[ : , 1:3] = imputer.transform(X[ : , 1:3]) 26 | ``` 27 | ## Step 4: Encoding categorical data 28 | ```python 29 | from sklearn.preprocessing import LabelEncoder, OneHotEncoder 30 | labelencoder_X = LabelEncoder() 31 | X[ : , 0] = labelencoder_X.fit_transform(X[ : , 0]) 32 | ``` 33 | ### Creating a dummy variable 34 | ```python 35 | onehotencoder = OneHotEncoder(categorical_features = [0]) 36 | X = onehotencoder.fit_transform(X).toarray() 37 | labelencoder_Y = LabelEncoder() 38 | Y = labelencoder_Y.fit_transform(Y) 39 | ``` 40 | ## Step 5: Splitting the datasets into training sets and Test sets 41 | ```python 42 | from sklearn.cross_validation import train_test_split 43 | X_train, X_test, Y_train, Y_test = train_test_split( X , Y , test_size = 0.2, random_state = 0) 44 | ``` 45 | 46 | ## Step 6: Feature Scaling 47 | ```python 48 | from sklearn.preprocessing import StandardScaler 49 | sc_X = StandardScaler() 50 | X_train = sc_X.fit_transform(X_train) 51 | X_test = sc_X.fit_transform(X_test) 52 | ``` 53 | ### Done :smile: 54 | -------------------------------------------------------------------------------- /Code/Day 25 Decision Tree.md: -------------------------------------------------------------------------------- 1 | # Decision Tree Classification 2 |

3 | 4 |

5 | 6 | ### Importing the libraries 7 | ```python 8 | import numpy as np 9 | import matplotlib.pyplot as plt 10 | import pandas as pd 11 | ``` 12 | 13 | ### Importing the dataset 14 | ```python 15 | dataset = pd.read_csv('Social_Network_Ads.csv') 16 | X = dataset.iloc[:, [2, 3]].values 17 | y = dataset.iloc[:, 4].values 18 | ``` 19 | ### Splitting the dataset into the Training set and Test set 20 | ```python 21 | from sklearn.cross_validation import train_test_split 22 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0) 23 | ``` 24 | 25 | ### Feature Scaling 26 | ```python 27 | from sklearn.preprocessing import StandardScaler 28 | sc = StandardScaler() 29 | X_train = sc.fit_transform(X_train) 30 | X_test = sc.transform(X_test) 31 | ``` 32 | ### Fitting Decision Tree Classification to the Training set 33 | ```python 34 | from sklearn.tree import DecisionTreeClassifier 35 | classifier = DecisionTreeClassifier(criterion = 'entropy', random_state = 0) 36 | classifier.fit(X_train, y_train) 37 | ``` 38 | ### Predicting the Test set results 39 | ```python 40 | y_pred = classifier.predict(X_test) 41 | ``` 42 | ### Making the Confusion Matrix 43 | ```python 44 | from sklearn.metrics import confusion_matrix 45 | cm = confusion_matrix(y_test, y_pred) 46 | ``` 47 | ### Visualising the Training set results 48 | ```python 49 | from matplotlib.colors import ListedColormap 50 | X_set, y_set = X_train, y_train 51 | X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), 52 | np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) 53 | plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), 54 | alpha = 0.75, cmap = ListedColormap(('red', 'green'))) 55 | plt.xlim(X1.min(), X1.max()) 56 | plt.ylim(X2.min(), X2.max()) 57 | for i, j in enumerate(np.unique(y_set)): 58 | plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], 59 | c = ListedColormap(('red', 'green'))(i), label = j) 60 | plt.title('Decision Tree Classification (Training set)') 61 | plt.xlabel('Age') 62 | plt.ylabel('Estimated Salary') 63 | plt.legend() 64 | plt.show() 65 | ``` 66 | ### Visualising the Test set results 67 | ```python 68 | from matplotlib.colors import ListedColormap 69 | X_set, y_set = X_test, y_test 70 | X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), 71 | np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) 72 | plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), 73 | alpha = 0.75, cmap = ListedColormap(('red', 'green'))) 74 | plt.xlim(X1.min(), X1.max()) 75 | plt.ylim(X2.min(), X2.max()) 76 | for i, j in enumerate(np.unique(y_set)): 77 | plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], 78 | c = ListedColormap(('red', 'green'))(i), label = j) 79 | plt.title('Decision Tree Classification (Test set)') 80 | plt.xlabel('Age') 81 | plt.ylabel('Estimated Salary') 82 | plt.legend() 83 | plt.show() 84 | ``` 85 | -------------------------------------------------------------------------------- /Code/Day 34 Random_Forest.md: -------------------------------------------------------------------------------- 1 | # Random Forests 2 |

3 | 4 |

5 | 6 | 7 | ### Importing the libraries 8 | ```python 9 | import numpy as np 10 | import matplotlib.pyplot as plt 11 | import pandas as pd 12 | ``` 13 | 14 | ### Importing the dataset 15 | ```python 16 | dataset = pd.read_csv('Social_Network_Ads.csv') 17 | X = dataset.iloc[:, [2, 3]].values 18 | y = dataset.iloc[:, 4].values 19 | ``` 20 | ### Splitting the dataset into the Training set and Test set 21 | ```python 22 | from sklearn.cross_validation import train_test_split 23 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0) 24 | ``` 25 | 26 | ### Feature Scaling 27 | ```python 28 | from sklearn.preprocessing import StandardScaler 29 | sc = StandardScaler() 30 | X_train = sc.fit_transform(X_train) 31 | X_test = sc.transform(X_test) 32 | ``` 33 | ### Fitting Random Forest to the Training set 34 | ```python 35 | from sklearn.ensemble import RandomForestClassifier 36 | classifier = RandomForestClassifier(n_estimators = 10, criterion = 'entropy', random_state = 0) 37 | classifier.fit(X_train, y_train) 38 | ``` 39 | ### Predicting the Test set results 40 | ```python 41 | y_pred = classifier.predict(X_test) 42 | ``` 43 | ### Making the Confusion Matrix 44 | ```python 45 | from sklearn.metrics import confusion_matrix 46 | cm = confusion_matrix(y_test, y_pred) 47 | ``` 48 | ### Visualising the Training set results 49 | ```python 50 | from matplotlib.colors import ListedColormap 51 | X_set, y_set = X_train, y_train 52 | X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), 53 | np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) 54 | plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), 55 | alpha = 0.75, cmap = ListedColormap(('red', 'green'))) 56 | plt.xlim(X1.min(), X1.max()) 57 | plt.ylim(X2.min(), X2.max()) 58 | for i, j in enumerate(np.unique(y_set)): 59 | plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], 60 | c = ListedColormap(('red', 'green'))(i), label = j) 61 | plt.title('Random Forest Classification (Training set)') 62 | plt.xlabel('Age') 63 | plt.ylabel('Estimated Salary') 64 | plt.legend() 65 | plt.show() 66 | ``` 67 | ### Visualising the Test set results 68 | ```python 69 | from matplotlib.colors import ListedColormap 70 | X_set, y_set = X_test, y_test 71 | X1, X2 = np.meshgrid(np.arange(start = X_set[:, 0].min() - 1, stop = X_set[:, 0].max() + 1, step = 0.01), 72 | np.arange(start = X_set[:, 1].min() - 1, stop = X_set[:, 1].max() + 1, step = 0.01)) 73 | plt.contourf(X1, X2, classifier.predict(np.array([X1.ravel(), X2.ravel()]).T).reshape(X1.shape), 74 | alpha = 0.75, cmap = ListedColormap(('red', 'green'))) 75 | plt.xlim(X1.min(), X1.max()) 76 | plt.ylim(X2.min(), X2.max()) 77 | for i, j in enumerate(np.unique(y_set)): 78 | plt.scatter(X_set[y_set == j, 0], X_set[y_set == j, 1], 79 | c = ListedColormap(('red', 'green'))(i), label = j) 80 | plt.title('Random Forest Classification (Test set)') 81 | plt.xlabel('Age') 82 | plt.ylabel('Estimated Salary') 83 | plt.legend() 84 | plt.show() 85 | ``` 86 | -------------------------------------------------------------------------------- /Code/Day 6 Logistic Regression.md: -------------------------------------------------------------------------------- 1 | # Logistic Regression 2 | 3 | 4 |

5 | 6 |

7 | 8 | ## The DataSet | Social Network 9 | 10 |

11 | 12 |

13 | 14 | This dataset contains information of users in a social network. Those informations are the user id the gender the age and the estimated salary. A car company has just launched their brand new luxury SUV. And we're trying to see which of these users of the social network are going to buy this brand new SUV And the last column here tells If yes or no the user bought this SUV we are going to build a model that is going to predict if a user is going to buy or not the SUV based on two variables which are going to be the age and the estimated salary. So our matrix of feature is only going to be these two columns. 15 | We want to find some correlations between the age and the estimated salary of a user and his decision to purchase yes or no the SUV. 16 | 17 | ## Step 1 | Data Pre-Processing 18 | 19 | ### Importing the Libraries 20 | 21 | ```python 22 | import numpy as np 23 | import matplotlib.pyplot as plt 24 | import pandas as pd 25 | ``` 26 | ### Importing the dataset 27 | 28 | Get the dataset from [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/datasets/Social_Network_Ads.csv) 29 | ```python 30 | dataset = pd.read_csv('Social_Network_Ads.csv') 31 | X = dataset.iloc[:, [2, 3]].values 32 | y = dataset.iloc[:, 4].values 33 | ``` 34 | 35 | ### Splitting the dataset into the Training set and Test set 36 | 37 | ```python 38 | from sklearn.cross_validation import train_test_split 39 | X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0) 40 | ``` 41 | 42 | ### Feature Scaling 43 | 44 | ```python 45 | from sklearn.preprocessing import StandardScaler 46 | sc = StandardScaler() 47 | X_train = sc.fit_transform(X_train) 48 | X_test = sc.transform(X_test) 49 | ``` 50 | ## Step 2 | Logistic Regression Model 51 | 52 | The library for this job which is going to be the linear model library and it is called linear because the logistic regression is a linear classifier which means that here since we're in two dimensions, our two categories of users are going to be separated by a straight line. Then import the logistic regression class. 53 | Next we will create a new object from this class which is going to be our classifier that we are going to fit on our training set. 54 | 55 | ### Fitting Logistic Regression to the Training set 56 | 57 | ```python 58 | from sklearn.linear_model import LogisticRegression 59 | classifier = LogisticRegression() 60 | classifier.fit(X_train, y_train) 61 | ``` 62 | ## Step 3 | Predection 63 | 64 | ### Predicting the Test set results 65 | 66 | ```python 67 | y_pred = classifier.predict(X_test) 68 | ``` 69 | 70 | ## Step 4 | Evaluating The Predection 71 | 72 | We predicted the test results and now we will evaluate if our logistic regression model learned and understood correctly. 73 | So this confusion matrix is going to contain the correct predictions that our model made on the set as well as the incorrect predictions. 74 | 75 | ### Making the Confusion Matrix 76 | 77 | ```python 78 | from sklearn.metrics import confusion_matrix 79 | cm = confusion_matrix(y_test, y_pred) 80 | ``` 81 | 82 | ## Visualization 83 | 84 |

85 | 86 |

87 | 88 |

89 | 90 |

91 | -------------------------------------------------------------------------------- /Code/Day2_Simple_Linear_Regression.md: -------------------------------------------------------------------------------- 1 | # Simple Linear Regression 2 | 3 | 4 |

5 | 6 |

7 | 8 | 9 | # Step 1: Data Preprocessing 10 | ```python 11 | import pandas as pd 12 | import numpy as np 13 | import matplotlib.pyplot as plt 14 | 15 | dataset = pd.read_csv('studentscores.csv') 16 | X = dataset.iloc[ : , : 1 ].values 17 | Y = dataset.iloc[ : , 1 ].values 18 | 19 | from sklearn.cross_validation import train_test_split 20 | X_train, X_test, Y_train, Y_test = train_test_split( X, Y, test_size = 1/4, random_state = 0) 21 | ``` 22 | 23 | # Step 2: Fitting Simple Linear Regression Model to the training set 24 | ```python 25 | from sklearn.linear_model import LinearRegression 26 | regressor = LinearRegression() 27 | regressor = regressor.fit(X_train, Y_train) 28 | ``` 29 | # Step 3: Predecting the Result 30 | ```python 31 | Y_pred = regressor.predict(X_test) 32 | ``` 33 | 34 | # Step 4: Visualization 35 | ## Visualising the Training results 36 | ```python 37 | plt.scatter(X_train , Y_train, color = 'red') 38 | plt.plot(X_train , regressor.predict(X_train), color ='blue') 39 | ``` 40 | ## Visualizing the test results 41 | ```python 42 | plt.scatter(X_test , Y_test, color = 'red') 43 | plt.plot(X_test , regressor.predict(X_test), color ='blue') 44 | ``` 45 | -------------------------------------------------------------------------------- /Code/Day3_Multiple_Linear_Regression.md: -------------------------------------------------------------------------------- 1 | # Multiple Linear Regression 2 | 3 | 4 |

5 | 6 |

7 | 8 | 9 | ## Step 1: Data Preprocessing 10 | 11 | ### Importing the libraries 12 | ```python 13 | import pandas as pd 14 | import numpy as np 15 | ``` 16 | ### Importing the dataset 17 | ```python 18 | dataset = pd.read_csv('50_Startups.csv') 19 | X = dataset.iloc[ : , :-1].values 20 | Y = dataset.iloc[ : , 4 ].values 21 | ``` 22 | 23 | ### Encoding Categorical data 24 | ```python 25 | from sklearn.preprocessing import LabelEncoder, OneHotEncoder 26 | labelencoder = LabelEncoder() 27 | X[: , 3] = labelencoder.fit_transform(X[ : , 3]) 28 | onehotencoder = OneHotEncoder(categorical_features = [3]) 29 | X = onehotencoder.fit_transform(X).toarray() 30 | ``` 31 | 32 | ### Avoiding Dummy Variable Trap 33 | ```python 34 | X = X[: , 1:] 35 | ``` 36 | 37 | ### Splitting the dataset into the Training set and Test set 38 | ```python 39 | from sklearn.cross_validation import train_test_split 40 | X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.2, random_state = 0) 41 | ``` 42 | ## Step 2: Fitting Multiple Linear Regression to the Training set 43 | ```python 44 | from sklearn.linear_model import LinearRegression 45 | regressor = LinearRegression() 46 | regressor.fit(X_train, Y_train) 47 | ``` 48 | 49 | ## Step 3: Predicting the Test set results 50 | ```python 51 | y_pred = regressor.predict(X_test) 52 | ``` 53 | -------------------------------------------------------------------------------- /Info-graphs/Day 1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 1.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 12.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 2.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 23.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 3.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 33.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 33.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 4.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 43.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 43.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 54.jpg -------------------------------------------------------------------------------- /Info-graphs/Day 7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Info-graphs/Day 7.jpg -------------------------------------------------------------------------------- /Info-graphs/readme.md: -------------------------------------------------------------------------------- 1 | Each Day Infograph 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Avik Jain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Other Docs/data.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Other Docs/data.PNG -------------------------------------------------------------------------------- /Other Docs/ets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Other Docs/ets.png -------------------------------------------------------------------------------- /Other Docs/readme.md: -------------------------------------------------------------------------------- 1 | Images for representation 2 | -------------------------------------------------------------------------------- /Other Docs/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Other Docs/test.png -------------------------------------------------------------------------------- /Other Docs/testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Other Docs/testing.png -------------------------------------------------------------------------------- /Other Docs/training.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Divyanshu-ISM/100-Days-Of-ML-Code/c3009b41272ce76ee1465aeaf40bf83752972b77/Other Docs/training.png -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Pull Request Prelude 2 | Thank you for your contribution :) 3 | 4 | Please complete the below steps before filing your PR: 5 | 6 | I have read and understood CONTRIBUTING document. 7 | I have read and understood CODE_OF_CONDUCT document. 8 | I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't. 9 | I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps. 10 | ## Why this change is necessary and useful 11 | [Please explain in detail why the changes in this PR are needed.] 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 100-Days-Of-ML-Code 2 | 3 | 100 Days of Machine Learning Coding as proposed by [Siraj Raval](https://github.com/llSourcell) 4 | 5 | Get the datasets from [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/tree/master/datasets) 6 | 7 | ## Data PreProcessing | Day 1 8 | Check out the code from [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day%201_Data%20PreProcessing.md). 9 | 10 |

11 | 12 |

13 | 14 | ## Simple Linear Regression | Day 2 15 | Check out the code from [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day2_Simple_Linear_Regression.md). 16 | 17 |

18 | 19 |

20 | 21 | ## Multiple Linear Regression | Day 3 22 | Check out the code from [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day3_Multiple_Linear_Regression.md). 23 | 24 |

25 | 26 |

27 | 28 | ## Logistic Regression | Day 4 29 | 30 |

31 | 32 |

33 | 34 | ## Logistic Regression | Day 5 35 | Moving forward into #100DaysOfMLCode today I dived into the deeper depth of what Logistic Regression actually is and what is the math involved behind it. Learned how cost function is calculated and then how to apply gradient descent algorithm to cost function to minimize the error in prediction. 36 | Due to less time I will now be posting an infographic on alternate days. 37 | Also if someone wants to help me out in documentaion of code and already has some experince in the field and knows Markdown for github please contact me on LinkedIn :) . 38 | 39 | ## Implementing Logistic Regression | Day 6 40 | Check out the Code [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day%206%20Logistic%20Regression.md) 41 | 42 | ## K Nearest Neighbours | Day 7 43 |

44 | 45 |

46 | 47 | ## Math Behind Logistic Regression | Day 8 48 | 49 | #100DaysOfMLCode To clear my insights on logistic regression I was searching on the internet for some resource or article and I came across this article (https://towardsdatascience.com/logistic-regression-detailed-overview-46c4da4303bc) by Saishruthi Swaminathan. 50 | 51 | It gives a detailed description of Logistic Regression. Do check it out. 52 | 53 | ## Support Vector Machines | Day 9 54 | Got an intution on what SVM is and how it is used to solve Classification problem. 55 | 56 | ## SVM and KNN | Day 10 57 | Learned more about how SVM works and implementing the K-NN algorithm. 58 | 59 | ## Implementation of K-NN | Day 11 60 | 61 | Implemented the K-NN algorithm for classification. #100DaysOfMLCode 62 | Support Vector Machine Infographic is halfway complete. Will update it tomorrow. 63 | 64 | ## Support Vector Machines | Day 12 65 |

66 | 67 |

68 | 69 | ## Naive Bayes Classifier | Day 13 70 | 71 | Continuing with #100DaysOfMLCode today I went through the Naive Bayes classifier. 72 | I am also implementing the SVM in python using scikit-learn. Will update the code soon. 73 | 74 | ## Implementation of SVM | Day 14 75 | Today I implemented SVM on linearly related data. Used Scikit-Learn library. In Scikit-Learn we have SVC classifier which we use to achieve this task. Will be using kernel-trick on next implementation. 76 | Check the code [here](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day%2013%20SVM.md). 77 | 78 | ## Naive Bayes Classifier and Black Box Machine Learning | Day 15 79 | Learned about different types of naive bayes classifiers. Also started the lectures by [Bloomberg](https://bloomberg.github.io/foml/#home). First one in the playlist was Black Box Machine Learning. It gives the whole overview about prediction functions, feature extraction, learning algorithms, performance evaluation, cross-validation, sample bias, nonstationarity, overfitting, and hyperparameter tuning. 80 | 81 | ## Implemented SVM using Kernel Trick | Day 16 82 | Using Scikit-Learn library implemented SVM algorithm along with kernel function which maps our data points into higher dimension to find optimal hyperplane. 83 | 84 | ## Started Deep learning Specialization on Coursera | Day 17 85 | Completed the whole Week 1 and Week 2 on a single day. Learned Logistic regression as Neural Network. 86 | 87 | ## Deep learning Specialization on Coursera | Day 18 88 | Completed the Course 1 of the deep learning specialization. Implemented a neural net in python. 89 | 90 | ## The Learning Problem , Professor Yaser Abu-Mostafa | Day 19 91 | Started Lecture 1 of 18 of Caltech's Machine Learning Course - CS 156 by Professor Yaser Abu-Mostafa. It was basically an introduction to the upcoming lectures. He also explained Perceptron Algorithm. 92 | 93 | ## Started Deep learning Specialization Course 2 | Day 20 94 | Completed the Week 1 of Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization. 95 | 96 | ## Web Scraping | Day 21 97 | Watched some tutorials on how to do web scraping using Beautiful Soup in order to collect data for building a model. 98 | 99 | ## Is Learning Feasible? | Day 22 100 | Lecture 2 of 18 of Caltech's Machine Learning Course - CS 156 by Professor Yaser Abu-Mostafa. Learned about Hoeffding Inequality. 101 | 102 | ## Decision Trees | Day 23 103 |

104 | 105 |

106 | 107 | ## Introduction To Statistical Learning Theory | Day 24 108 | Lec 3 of Bloomberg ML course introduced some of the core concepts like input space, action space, outcome space, prediction functions, loss functions, and hypothesis spaces. 109 | 110 | ## Implementing Decision Trees | Day 25 111 | Check the code [here.](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day%2025%20Decision%20Tree.md) 112 | 113 | ## Jumped To Brush up Linear Algebra | Day 26 114 | Found an amazing [channel](https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw) on youtube 3Blue1Brown. It has a playlist called Essence of Linear Algebra. Started off by completing 4 videos which gave a complete overview of Vectors, Linear Combinations, Spans, Basis Vectors, Linear Transformations and Matrix Multiplication. 115 | 116 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) 117 | 118 | ## Jumped To Brush up Linear Algebra | Day 27 119 | Continuing with the playlist completed next 4 videos discussing topics 3D Transformations, Determinants, Inverse Matrix, Column Space, Null Space and Non-Square Matrices. 120 | 121 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) 122 | 123 | ## Jumped To Brush up Linear Algebra | Day 28 124 | In the playlist of 3Blue1Brown completed another 3 videos from the essence of linear algebra. 125 | Topics covered were Dot Product and Cross Product. 126 | 127 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) 128 | 129 | 130 | ## Jumped To Brush up Linear Algebra | Day 29 131 | Completed the whole playlist today, videos 12-14. Really an amazing playlist to refresh the concepts of Linear Algebra. 132 | Topics covered were the change of basis, Eigenvectors and Eigenvalues, and Abstract Vector Spaces. 133 | 134 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) 135 | 136 | ## Essence of calculus | Day 30 137 | Completing the playlist - Essence of Linear Algebra by 3blue1brown a suggestion popped up by youtube regarding a series of videos again by the same channel 3Blue1Brown. Being already impressed by the previous series on Linear algebra I dived straight into it. 138 | Completed about 5 videos on topics such as Derivatives, Chain Rule, Product Rule, and derivative of exponential. 139 | 140 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53DwVRMYO3t5Yr) 141 | 142 | ## Essence of calculus | Day 31 143 | Watched 2 Videos on topic Implicit Diffrentiation and Limits from the playlist Essence of Calculus. 144 | 145 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53DwVRMYO3t5Yr) 146 | 147 | ## Essence of calculus | Day 32 148 | Watched the remaining 4 videos covering topics Like Integration and Higher order derivatives. 149 | 150 | Link to the playlist [here.](https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53DwVRMYO3t5Yr) 151 | 152 | ## Random Forests | Day 33 153 |

154 | 155 |

156 | 157 | ## Implementing Random Forests | Day 34 158 | Check the code [here.](https://github.com/Avik-Jain/100-Days-Of-ML-Code/blob/master/Code/Day%2034%20Random_Forest.md) 159 | 160 | ## But what *is* a Neural Network? | Deep learning, chapter 1 | Day 35 161 | An Amazing Video on neural networks by 3Blue1Brown youtube channel. This video gives a good understanding of Neural Networks and uses Handwritten digit dataset to explain the concept. 162 | Link To the [video.](https://www.youtube.com/watch?v=aircAruvnKk&t=7s) 163 | 164 | ## Gradient descent, how neural networks learn | Deep learning, chapter 2 | Day 36 165 | Part two of neural networks by 3Blue1Brown youtube channel. This video explains the concepts of Gradient Descent in an interesting way. 169 must watch and highly recommended. 166 | Link To the [video.](https://www.youtube.com/watch?v=IHZwWFHWa-w) 167 | 168 | ## What is backpropagation really doing? | Deep learning, chapter 3 | Day 37 169 | Part three of neural networks by 3Blue1Brown youtube channel. This video mostly discusses the partial derivatives and backpropagation. 170 | Link To the [video.](https://www.youtube.com/watch?v=Ilg3gGewQ5U) 171 | 172 | ## Backpropagation calculus | Deep learning, chapter 4 | Day 38 173 | Part four of neural networks by 3Blue1Brown youtube channel. The goal here is to represent, in somewhat more formal terms, the intuition for how backpropagation works and the video moslty discusses the partial derivatives and backpropagation. 174 | Link To the [video.](https://www.youtube.com/watch?v=tIeHLnjs5U8) 175 | 176 | ## Deep Learning with Python, TensorFlow, and Keras tutorial | Day 39 177 | Link To the [video.](https://www.youtube.com/watch?v=wQ8BIBpya2k&t=19s&index=2&list=PLQVvvaa0QuDfhTox0AjmQ6tvTgMBZBEXN) 178 | 179 | ## Loading in your own data - Deep Learning basics with Python, TensorFlow and Keras p.2 | Day 40 180 | Link To the [video.](https://www.youtube.com/watch?v=j-3vuBynnOE&list=PLQVvvaa0QuDfhTox0AjmQ6tvTgMBZBEXN&index=2) 181 | 182 | ## Convolutional Neural Networks - Deep Learning basics with Python, TensorFlow and Keras p.3 | Day 41 183 | Link To the [video.](https://www.youtube.com/watch?v=WvoLTXIjBYU&list=PLQVvvaa0QuDfhTox0AjmQ6tvTgMBZBEXN&index=3) 184 | 185 | ## Analyzing Models with TensorBoard - Deep Learning with Python, TensorFlow and Keras p.4 | Day 42 186 | Link To the [video.](https://www.youtube.com/watch?v=BqgTU7_cBnk&list=PLQVvvaa0QuDfhTox0AjmQ6tvTgMBZBEXN&index=4) 187 | 188 | ## K Means Clustering | Day 43 189 | Moved to Unsupervised Learning and studied about Clustering. 190 | Working on my website check it out [avikjain.me](http://www.avikjain.me/) 191 | Also found a wonderful animation that can help to easily understand K - Means Clustering [Link](http://shabal.in/visuals/kmeans/6.html) 192 | 193 |

194 | 195 |

196 | 197 | ## K Means Clustering Implementation | Day 44 198 | Implemented K Means Clustering. Check the code [here.]() 199 | 200 | ## Digging Deeper | NUMPY | Day 45 201 | Got a new book "Python Data Science HandBook" by JK VanderPlas Check the Jupyter notebooks [here.](https://github.com/jakevdp/PythonDataScienceHandbook) 202 |
Started with chapter 2 : Introduction to Numpy. Covered topics like Data Types, Numpy arrays and Computations on Numpy arrays. 203 |
Check the code - 204 |
[Introduction to NumPy](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.00-Introduction-to-NumPy.ipynb) 205 |
[Understanding Data Types in Python](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.01-Understanding-Data-Types.ipynb) 206 |
[The Basics of NumPy Arrays](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.02-The-Basics-Of-NumPy-Arrays.ipynb) 207 |
[Computation on NumPy Arrays: Universal Functions](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.03-Computation-on-arrays-ufuncs.ipynb) 208 | 209 | ## Digging Deeper | NUMPY | Day 46 210 | Chapter 2 : Aggregations, Comparisions and Broadcasting 211 |
Link to Notebook: 212 |
[Aggregations: Min, Max, and Everything In Between](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.04-Computation-on-arrays-aggregates.ipynb) 213 |
[Computation on Arrays: Broadcasting](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.05-Computation-on-arrays-broadcasting.ipynb) 214 |
[Comparisons, Masks, and Boolean Logic](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.06-Boolean-Arrays-and-Masks.ipynb) 215 | 216 | ## Digging Deeper | NUMPY | Day 47 217 | Chapter 2 : Fancy Indexing, sorting arrays, Struchered Data 218 |
Link to Notebook: 219 |
[Fancy Indexing](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.07-Fancy-Indexing.ipynb) 220 |
[Sorting Arrays](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.08-Sorting.ipynb) 221 |
[Structured Data: NumPy's Structured Arrays](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.09-
Structured-Data-NumPy.ipynb) 222 | 223 | ## Digging Deeper | PANDAS | Day 48 224 | Chapter 3 : Data Manipulation with Pandas 225 |
Covered Various topics like Pandas Objects, Data Indexing and Selection, Operating on Data, Handling Missing Data, Hierarchical Indexing, ConCat and Append. 226 |
Link To the Notebooks: 227 |
[Data Manipulation with Pandas](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.00-Introduction-to-Pandas.ipynb) 228 |
[Introducing Pandas Objects](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.01-Introducing-Pandas-Objects.ipynb) 229 |
[Data Indexing and Selection](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.02-Data-Indexing-and-Selection.ipynb) 230 |
[Operating on Data in Pandas](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.03-Operations-in-Pandas.ipynb) 231 |
[Handling Missing Data](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.04-Missing-Values.ipynb) 232 |
[Hierarchical Indexing](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.05-Hierarchical-Indexing.ipynb) 233 |
[Combining Datasets: Concat and Append](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.06-Concat-And-Append.ipynb) 234 | 235 | ## Digging Deeper | PANDAS | Day 49 236 | Chapter 3: Completed following topics- Merge and Join, Aggregation and grouping and Pivot Tables. 237 |
[Combining Datasets: Merge and Join](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.07-Merge-and-Join.ipynb) 238 |
[Aggregation and Grouping](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.08-Aggregation-and-Grouping.ipynb) 239 |
[Pivot Tables](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.09-Pivot-Tables.ipynb) 240 | 241 | ## Digging Deeper | PANDAS | Day 50 242 | Chapter 3: Vectorized Strings Operations, Working with Time Series 243 |
Links to Notebooks: 244 |
[Vectorized String Operations](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.10-Working-With-Strings.ipynb) 245 |
[Working with Time Series](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.11-Working-with-Time-Series.ipynb) 246 |
[High-Performance Pandas: eval() and query()](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/03.12-Performance-Eval-and-Query.ipynb) 247 | 248 | ## Digging Deeper | MATPLOTLIB | Day 51 249 | Chapter 4: Visualization with Matplotlib 250 | Learned about Simple Line Plots, Simple Scatter Plotsand Density and Contour Plots. 251 |
Links to Notebooks: 252 |
[Visualization with Matplotlib](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.00-Introduction-To-Matplotlib.ipynb) 253 |
[Simple Line Plots](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.01-Simple-Line-Plots.ipynb) 254 |
[Simple Scatter Plots](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.02-Simple-Scatter-Plots.ipynb) 255 |
[Visualizing Errors](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.03-Errorbars.ipynb) 256 |
[Density and Contour Plots](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.04-Density-and-Contour-Plots.ipynb) 257 | 258 | ## Digging Deeper | MATPLOTLIB | Day 52 259 | Chapter 4: Visualization with Matplotlib 260 | Learned about Histograms, How to customize plot legends, colorbars, and buliding Multiple Subplots. 261 |
Links to Notebooks: 262 |
[Histograms, Binnings, and Density](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.05-Histograms-and-Binnings.ipynb) 263 |
[Customizing Plot Legends](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.06-Customizing-Legends.ipynb) 264 |
[Customizing Colorbars](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.07-Customizing-Colorbars.ipynb) 265 |
[Multiple Subplots](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.08-Multiple-Subplots.ipynb) 266 |
[Text and Annotation](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.09-Text-and-Annotation.ipynb) 267 | 268 | ## Digging Deeper | MATPLOTLIB | Day 53 269 | Chapter 4: Covered Three Dimensional Plotting in Mathplotlib. 270 |
Links to Notebooks: 271 |
[Three-Dimensional Plotting in Matplotlib](https://github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/04.12-Three-Dimensional-Plotting.ipynb) 272 | 273 | ## Hierarchical Clustering | Day 54 274 | Studied about Hierarchical Clustering. 275 | Check out this amazing [Visualization.](https://cdn-images-1.medium.com/max/800/1*ET8kCcPpr893vNZFs8j4xg.gif) 276 |

277 | 278 |

279 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-merlot -------------------------------------------------------------------------------- /datasets/50_Startups.csv: -------------------------------------------------------------------------------- 1 | R&D Spend,Administration,Marketing Spend,State,Profit 2 | 165349.2,136897.8,471784.1,New York,192261.83 3 | 162597.7,151377.59,443898.53,California,191792.06 4 | 153441.51,101145.55,407934.54,Florida,191050.39 5 | 144372.41,118671.85,383199.62,New York,182901.99 6 | 142107.34,91391.77,366168.42,Florida,166187.94 7 | 131876.9,99814.71,362861.36,New York,156991.12 8 | 134615.46,147198.87,127716.82,California,156122.51 9 | 130298.13,145530.06,323876.68,Florida,155752.6 10 | 120542.52,148718.95,311613.29,New York,152211.77 11 | 123334.88,108679.17,304981.62,California,149759.96 12 | 101913.08,110594.11,229160.95,Florida,146121.95 13 | 100671.96,91790.61,249744.55,California,144259.4 14 | 93863.75,127320.38,249839.44,Florida,141585.52 15 | 91992.39,135495.07,252664.93,California,134307.35 16 | 119943.24,156547.42,256512.92,Florida,132602.65 17 | 114523.61,122616.84,261776.23,New York,129917.04 18 | 78013.11,121597.55,264346.06,California,126992.93 19 | 94657.16,145077.58,282574.31,New York,125370.37 20 | 91749.16,114175.79,294919.57,Florida,124266.9 21 | 86419.7,153514.11,0,New York,122776.86 22 | 76253.86,113867.3,298664.47,California,118474.03 23 | 78389.47,153773.43,299737.29,New York,111313.02 24 | 73994.56,122782.75,303319.26,Florida,110352.25 25 | 67532.53,105751.03,304768.73,Florida,108733.99 26 | 77044.01,99281.34,140574.81,New York,108552.04 27 | 64664.71,139553.16,137962.62,California,107404.34 28 | 75328.87,144135.98,134050.07,Florida,105733.54 29 | 72107.6,127864.55,353183.81,New York,105008.31 30 | 66051.52,182645.56,118148.2,Florida,103282.38 31 | 65605.48,153032.06,107138.38,New York,101004.64 32 | 61994.48,115641.28,91131.24,Florida,99937.59 33 | 61136.38,152701.92,88218.23,New York,97483.56 34 | 63408.86,129219.61,46085.25,California,97427.84 35 | 55493.95,103057.49,214634.81,Florida,96778.92 36 | 46426.07,157693.92,210797.67,California,96712.8 37 | 46014.02,85047.44,205517.64,New York,96479.51 38 | 28663.76,127056.21,201126.82,Florida,90708.19 39 | 44069.95,51283.14,197029.42,California,89949.14 40 | 20229.59,65947.93,185265.1,New York,81229.06 41 | 38558.51,82982.09,174999.3,California,81005.76 42 | 28754.33,118546.05,172795.67,California,78239.91 43 | 27892.92,84710.77,164470.71,Florida,77798.83 44 | 23640.93,96189.63,148001.11,California,71498.49 45 | 15505.73,127382.3,35534.17,New York,69758.98 46 | 22177.74,154806.14,28334.72,California,65200.33 47 | 1000.23,124153.04,1903.93,New York,64926.08 48 | 1315.46,115816.21,297114.46,Florida,49490.75 49 | 0,135426.92,0,California,42559.73 50 | 542.05,51743.15,0,New York,35673.41 51 | 0,116983.8,45173.06,California,14681.4 -------------------------------------------------------------------------------- /datasets/Data.csv: -------------------------------------------------------------------------------- 1 | Country,Age,Salary,Purchased 2 | France,44,72000,No 3 | Spain,27,48000,Yes 4 | Germany,30,54000,No 5 | Spain,38,61000,No 6 | Germany,40,,Yes 7 | France,35,58000,Yes 8 | Spain,,52000,No 9 | France,48,79000,Yes 10 | Germany,50,83000,No 11 | France,37,67000,Yes -------------------------------------------------------------------------------- /datasets/Social_Network_Ads.csv: -------------------------------------------------------------------------------- 1 | User ID,Gender,Age,EstimatedSalary,Purchased 2 | 15624510,Male,19,19000,0 3 | 15810944,Male,35,20000,0 4 | 15668575,Female,26,43000,0 5 | 15603246,Female,27,57000,0 6 | 15804002,Male,19,76000,0 7 | 15728773,Male,27,58000,0 8 | 15598044,Female,27,84000,0 9 | 15694829,Female,32,150000,1 10 | 15600575,Male,25,33000,0 11 | 15727311,Female,35,65000,0 12 | 15570769,Female,26,80000,0 13 | 15606274,Female,26,52000,0 14 | 15746139,Male,20,86000,0 15 | 15704987,Male,32,18000,0 16 | 15628972,Male,18,82000,0 17 | 15697686,Male,29,80000,0 18 | 15733883,Male,47,25000,1 19 | 15617482,Male,45,26000,1 20 | 15704583,Male,46,28000,1 21 | 15621083,Female,48,29000,1 22 | 15649487,Male,45,22000,1 23 | 15736760,Female,47,49000,1 24 | 15714658,Male,48,41000,1 25 | 15599081,Female,45,22000,1 26 | 15705113,Male,46,23000,1 27 | 15631159,Male,47,20000,1 28 | 15792818,Male,49,28000,1 29 | 15633531,Female,47,30000,1 30 | 15744529,Male,29,43000,0 31 | 15669656,Male,31,18000,0 32 | 15581198,Male,31,74000,0 33 | 15729054,Female,27,137000,1 34 | 15573452,Female,21,16000,0 35 | 15776733,Female,28,44000,0 36 | 15724858,Male,27,90000,0 37 | 15713144,Male,35,27000,0 38 | 15690188,Female,33,28000,0 39 | 15689425,Male,30,49000,0 40 | 15671766,Female,26,72000,0 41 | 15782806,Female,27,31000,0 42 | 15764419,Female,27,17000,0 43 | 15591915,Female,33,51000,0 44 | 15772798,Male,35,108000,0 45 | 15792008,Male,30,15000,0 46 | 15715541,Female,28,84000,0 47 | 15639277,Male,23,20000,0 48 | 15798850,Male,25,79000,0 49 | 15776348,Female,27,54000,0 50 | 15727696,Male,30,135000,1 51 | 15793813,Female,31,89000,0 52 | 15694395,Female,24,32000,0 53 | 15764195,Female,18,44000,0 54 | 15744919,Female,29,83000,0 55 | 15671655,Female,35,23000,0 56 | 15654901,Female,27,58000,0 57 | 15649136,Female,24,55000,0 58 | 15775562,Female,23,48000,0 59 | 15807481,Male,28,79000,0 60 | 15642885,Male,22,18000,0 61 | 15789109,Female,32,117000,0 62 | 15814004,Male,27,20000,0 63 | 15673619,Male,25,87000,0 64 | 15595135,Female,23,66000,0 65 | 15583681,Male,32,120000,1 66 | 15605000,Female,59,83000,0 67 | 15718071,Male,24,58000,0 68 | 15679760,Male,24,19000,0 69 | 15654574,Female,23,82000,0 70 | 15577178,Female,22,63000,0 71 | 15595324,Female,31,68000,0 72 | 15756932,Male,25,80000,0 73 | 15726358,Female,24,27000,0 74 | 15595228,Female,20,23000,0 75 | 15782530,Female,33,113000,0 76 | 15592877,Male,32,18000,0 77 | 15651983,Male,34,112000,1 78 | 15746737,Male,18,52000,0 79 | 15774179,Female,22,27000,0 80 | 15667265,Female,28,87000,0 81 | 15655123,Female,26,17000,0 82 | 15595917,Male,30,80000,0 83 | 15668385,Male,39,42000,0 84 | 15709476,Male,20,49000,0 85 | 15711218,Male,35,88000,0 86 | 15798659,Female,30,62000,0 87 | 15663939,Female,31,118000,1 88 | 15694946,Male,24,55000,0 89 | 15631912,Female,28,85000,0 90 | 15768816,Male,26,81000,0 91 | 15682268,Male,35,50000,0 92 | 15684801,Male,22,81000,0 93 | 15636428,Female,30,116000,0 94 | 15809823,Male,26,15000,0 95 | 15699284,Female,29,28000,0 96 | 15786993,Female,29,83000,0 97 | 15709441,Female,35,44000,0 98 | 15710257,Female,35,25000,0 99 | 15582492,Male,28,123000,1 100 | 15575694,Male,35,73000,0 101 | 15756820,Female,28,37000,0 102 | 15766289,Male,27,88000,0 103 | 15593014,Male,28,59000,0 104 | 15584545,Female,32,86000,0 105 | 15675949,Female,33,149000,1 106 | 15672091,Female,19,21000,0 107 | 15801658,Male,21,72000,0 108 | 15706185,Female,26,35000,0 109 | 15789863,Male,27,89000,0 110 | 15720943,Male,26,86000,0 111 | 15697997,Female,38,80000,0 112 | 15665416,Female,39,71000,0 113 | 15660200,Female,37,71000,0 114 | 15619653,Male,38,61000,0 115 | 15773447,Male,37,55000,0 116 | 15739160,Male,42,80000,0 117 | 15689237,Male,40,57000,0 118 | 15679297,Male,35,75000,0 119 | 15591433,Male,36,52000,0 120 | 15642725,Male,40,59000,0 121 | 15701962,Male,41,59000,0 122 | 15811613,Female,36,75000,0 123 | 15741049,Male,37,72000,0 124 | 15724423,Female,40,75000,0 125 | 15574305,Male,35,53000,0 126 | 15678168,Female,41,51000,0 127 | 15697020,Female,39,61000,0 128 | 15610801,Male,42,65000,0 129 | 15745232,Male,26,32000,0 130 | 15722758,Male,30,17000,0 131 | 15792102,Female,26,84000,0 132 | 15675185,Male,31,58000,0 133 | 15801247,Male,33,31000,0 134 | 15725660,Male,30,87000,0 135 | 15638963,Female,21,68000,0 136 | 15800061,Female,28,55000,0 137 | 15578006,Male,23,63000,0 138 | 15668504,Female,20,82000,0 139 | 15687491,Male,30,107000,1 140 | 15610403,Female,28,59000,0 141 | 15741094,Male,19,25000,0 142 | 15807909,Male,19,85000,0 143 | 15666141,Female,18,68000,0 144 | 15617134,Male,35,59000,0 145 | 15783029,Male,30,89000,0 146 | 15622833,Female,34,25000,0 147 | 15746422,Female,24,89000,0 148 | 15750839,Female,27,96000,1 149 | 15749130,Female,41,30000,0 150 | 15779862,Male,29,61000,0 151 | 15767871,Male,20,74000,0 152 | 15679651,Female,26,15000,0 153 | 15576219,Male,41,45000,0 154 | 15699247,Male,31,76000,0 155 | 15619087,Female,36,50000,0 156 | 15605327,Male,40,47000,0 157 | 15610140,Female,31,15000,0 158 | 15791174,Male,46,59000,0 159 | 15602373,Male,29,75000,0 160 | 15762605,Male,26,30000,0 161 | 15598840,Female,32,135000,1 162 | 15744279,Male,32,100000,1 163 | 15670619,Male,25,90000,0 164 | 15599533,Female,37,33000,0 165 | 15757837,Male,35,38000,0 166 | 15697574,Female,33,69000,0 167 | 15578738,Female,18,86000,0 168 | 15762228,Female,22,55000,0 169 | 15614827,Female,35,71000,0 170 | 15789815,Male,29,148000,1 171 | 15579781,Female,29,47000,0 172 | 15587013,Male,21,88000,0 173 | 15570932,Male,34,115000,0 174 | 15794661,Female,26,118000,0 175 | 15581654,Female,34,43000,0 176 | 15644296,Female,34,72000,0 177 | 15614420,Female,23,28000,0 178 | 15609653,Female,35,47000,0 179 | 15594577,Male,25,22000,0 180 | 15584114,Male,24,23000,0 181 | 15673367,Female,31,34000,0 182 | 15685576,Male,26,16000,0 183 | 15774727,Female,31,71000,0 184 | 15694288,Female,32,117000,1 185 | 15603319,Male,33,43000,0 186 | 15759066,Female,33,60000,0 187 | 15814816,Male,31,66000,0 188 | 15724402,Female,20,82000,0 189 | 15571059,Female,33,41000,0 190 | 15674206,Male,35,72000,0 191 | 15715160,Male,28,32000,0 192 | 15730448,Male,24,84000,0 193 | 15662067,Female,19,26000,0 194 | 15779581,Male,29,43000,0 195 | 15662901,Male,19,70000,0 196 | 15689751,Male,28,89000,0 197 | 15667742,Male,34,43000,0 198 | 15738448,Female,30,79000,0 199 | 15680243,Female,20,36000,0 200 | 15745083,Male,26,80000,0 201 | 15708228,Male,35,22000,0 202 | 15628523,Male,35,39000,0 203 | 15708196,Male,49,74000,0 204 | 15735549,Female,39,134000,1 205 | 15809347,Female,41,71000,0 206 | 15660866,Female,58,101000,1 207 | 15766609,Female,47,47000,0 208 | 15654230,Female,55,130000,1 209 | 15794566,Female,52,114000,0 210 | 15800890,Female,40,142000,1 211 | 15697424,Female,46,22000,0 212 | 15724536,Female,48,96000,1 213 | 15735878,Male,52,150000,1 214 | 15707596,Female,59,42000,0 215 | 15657163,Male,35,58000,0 216 | 15622478,Male,47,43000,0 217 | 15779529,Female,60,108000,1 218 | 15636023,Male,49,65000,0 219 | 15582066,Male,40,78000,0 220 | 15666675,Female,46,96000,0 221 | 15732987,Male,59,143000,1 222 | 15789432,Female,41,80000,0 223 | 15663161,Male,35,91000,1 224 | 15694879,Male,37,144000,1 225 | 15593715,Male,60,102000,1 226 | 15575002,Female,35,60000,0 227 | 15622171,Male,37,53000,0 228 | 15795224,Female,36,126000,1 229 | 15685346,Male,56,133000,1 230 | 15691808,Female,40,72000,0 231 | 15721007,Female,42,80000,1 232 | 15794253,Female,35,147000,1 233 | 15694453,Male,39,42000,0 234 | 15813113,Male,40,107000,1 235 | 15614187,Male,49,86000,1 236 | 15619407,Female,38,112000,0 237 | 15646227,Male,46,79000,1 238 | 15660541,Male,40,57000,0 239 | 15753874,Female,37,80000,0 240 | 15617877,Female,46,82000,0 241 | 15772073,Female,53,143000,1 242 | 15701537,Male,42,149000,1 243 | 15736228,Male,38,59000,0 244 | 15780572,Female,50,88000,1 245 | 15769596,Female,56,104000,1 246 | 15586996,Female,41,72000,0 247 | 15722061,Female,51,146000,1 248 | 15638003,Female,35,50000,0 249 | 15775590,Female,57,122000,1 250 | 15730688,Male,41,52000,0 251 | 15753102,Female,35,97000,1 252 | 15810075,Female,44,39000,0 253 | 15723373,Male,37,52000,0 254 | 15795298,Female,48,134000,1 255 | 15584320,Female,37,146000,1 256 | 15724161,Female,50,44000,0 257 | 15750056,Female,52,90000,1 258 | 15609637,Female,41,72000,0 259 | 15794493,Male,40,57000,0 260 | 15569641,Female,58,95000,1 261 | 15815236,Female,45,131000,1 262 | 15811177,Female,35,77000,0 263 | 15680587,Male,36,144000,1 264 | 15672821,Female,55,125000,1 265 | 15767681,Female,35,72000,0 266 | 15600379,Male,48,90000,1 267 | 15801336,Female,42,108000,1 268 | 15721592,Male,40,75000,0 269 | 15581282,Male,37,74000,0 270 | 15746203,Female,47,144000,1 271 | 15583137,Male,40,61000,0 272 | 15680752,Female,43,133000,0 273 | 15688172,Female,59,76000,1 274 | 15791373,Male,60,42000,1 275 | 15589449,Male,39,106000,1 276 | 15692819,Female,57,26000,1 277 | 15727467,Male,57,74000,1 278 | 15734312,Male,38,71000,0 279 | 15764604,Male,49,88000,1 280 | 15613014,Female,52,38000,1 281 | 15759684,Female,50,36000,1 282 | 15609669,Female,59,88000,1 283 | 15685536,Male,35,61000,0 284 | 15750447,Male,37,70000,1 285 | 15663249,Female,52,21000,1 286 | 15638646,Male,48,141000,0 287 | 15734161,Female,37,93000,1 288 | 15631070,Female,37,62000,0 289 | 15761950,Female,48,138000,1 290 | 15649668,Male,41,79000,0 291 | 15713912,Female,37,78000,1 292 | 15586757,Male,39,134000,1 293 | 15596522,Male,49,89000,1 294 | 15625395,Male,55,39000,1 295 | 15760570,Male,37,77000,0 296 | 15566689,Female,35,57000,0 297 | 15725794,Female,36,63000,0 298 | 15673539,Male,42,73000,1 299 | 15705298,Female,43,112000,1 300 | 15675791,Male,45,79000,0 301 | 15747043,Male,46,117000,1 302 | 15736397,Female,58,38000,1 303 | 15678201,Male,48,74000,1 304 | 15720745,Female,37,137000,1 305 | 15637593,Male,37,79000,1 306 | 15598070,Female,40,60000,0 307 | 15787550,Male,42,54000,0 308 | 15603942,Female,51,134000,0 309 | 15733973,Female,47,113000,1 310 | 15596761,Male,36,125000,1 311 | 15652400,Female,38,50000,0 312 | 15717893,Female,42,70000,0 313 | 15622585,Male,39,96000,1 314 | 15733964,Female,38,50000,0 315 | 15753861,Female,49,141000,1 316 | 15747097,Female,39,79000,0 317 | 15594762,Female,39,75000,1 318 | 15667417,Female,54,104000,1 319 | 15684861,Male,35,55000,0 320 | 15742204,Male,45,32000,1 321 | 15623502,Male,36,60000,0 322 | 15774872,Female,52,138000,1 323 | 15611191,Female,53,82000,1 324 | 15674331,Male,41,52000,0 325 | 15619465,Female,48,30000,1 326 | 15575247,Female,48,131000,1 327 | 15695679,Female,41,60000,0 328 | 15713463,Male,41,72000,0 329 | 15785170,Female,42,75000,0 330 | 15796351,Male,36,118000,1 331 | 15639576,Female,47,107000,1 332 | 15693264,Male,38,51000,0 333 | 15589715,Female,48,119000,1 334 | 15769902,Male,42,65000,0 335 | 15587177,Male,40,65000,0 336 | 15814553,Male,57,60000,1 337 | 15601550,Female,36,54000,0 338 | 15664907,Male,58,144000,1 339 | 15612465,Male,35,79000,0 340 | 15810800,Female,38,55000,0 341 | 15665760,Male,39,122000,1 342 | 15588080,Female,53,104000,1 343 | 15776844,Male,35,75000,0 344 | 15717560,Female,38,65000,0 345 | 15629739,Female,47,51000,1 346 | 15729908,Male,47,105000,1 347 | 15716781,Female,41,63000,0 348 | 15646936,Male,53,72000,1 349 | 15768151,Female,54,108000,1 350 | 15579212,Male,39,77000,0 351 | 15721835,Male,38,61000,0 352 | 15800515,Female,38,113000,1 353 | 15591279,Male,37,75000,0 354 | 15587419,Female,42,90000,1 355 | 15750335,Female,37,57000,0 356 | 15699619,Male,36,99000,1 357 | 15606472,Male,60,34000,1 358 | 15778368,Male,54,70000,1 359 | 15671387,Female,41,72000,0 360 | 15573926,Male,40,71000,1 361 | 15709183,Male,42,54000,0 362 | 15577514,Male,43,129000,1 363 | 15778830,Female,53,34000,1 364 | 15768072,Female,47,50000,1 365 | 15768293,Female,42,79000,0 366 | 15654456,Male,42,104000,1 367 | 15807525,Female,59,29000,1 368 | 15574372,Female,58,47000,1 369 | 15671249,Male,46,88000,1 370 | 15779744,Male,38,71000,0 371 | 15624755,Female,54,26000,1 372 | 15611430,Female,60,46000,1 373 | 15774744,Male,60,83000,1 374 | 15629885,Female,39,73000,0 375 | 15708791,Male,59,130000,1 376 | 15793890,Female,37,80000,0 377 | 15646091,Female,46,32000,1 378 | 15596984,Female,46,74000,0 379 | 15800215,Female,42,53000,0 380 | 15577806,Male,41,87000,1 381 | 15749381,Female,58,23000,1 382 | 15683758,Male,42,64000,0 383 | 15670615,Male,48,33000,1 384 | 15715622,Female,44,139000,1 385 | 15707634,Male,49,28000,1 386 | 15806901,Female,57,33000,1 387 | 15775335,Male,56,60000,1 388 | 15724150,Female,49,39000,1 389 | 15627220,Male,39,71000,0 390 | 15672330,Male,47,34000,1 391 | 15668521,Female,48,35000,1 392 | 15807837,Male,48,33000,1 393 | 15592570,Male,47,23000,1 394 | 15748589,Female,45,45000,1 395 | 15635893,Male,60,42000,1 396 | 15757632,Female,39,59000,0 397 | 15691863,Female,46,41000,1 398 | 15706071,Male,51,23000,1 399 | 15654296,Female,50,20000,1 400 | 15755018,Male,36,33000,0 401 | 15594041,Female,49,36000,1 -------------------------------------------------------------------------------- /datasets/readme.md: -------------------------------------------------------------------------------- 1 | Day wise Dataset Used in Code 2 | -------------------------------------------------------------------------------- /datasets/studentscores.csv: -------------------------------------------------------------------------------- 1 | Hours,Scores 2 | 2.5,21 3 | 5.1,47 4 | 3.2,27 5 | 8.5,75 6 | 3.5,30 7 | 1.5,20 8 | 9.2,88 9 | 5.5,60 10 | 8.3,81 11 | 2.7,25 12 | 7.7,85 13 | 5.9,62 14 | 4.5,41 15 | 3.3,42 16 | 1.1,17 17 | 8.9,95 18 | 2.5,30 19 | 1.9,24 20 | 6.1,67 21 | 7.4,69 22 | 2.7,30 23 | 4.8,54 24 | 3.8,35 25 | 6.9,76 26 | 7.8,86 27 | -------------------------------------------------------------------------------- /index.py: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------