{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/Sahel-Eskandar/Project-Notebooks/blob/main/4_Visualization_with_Seaborn.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.074223,
          "end_time": "2021-03-17T14:55:24.280408",
          "exception": false,
          "start_time": "2021-03-17T14:55:24.206185",
          "status": "completed"
        },
        "tags": [],
        "id": "rW_UQcuFSBGd"
      },
      "source": [
        "# Exploratory Data Analysis and Visualization with Seaborn"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.072282,
          "end_time": "2021-03-17T14:55:24.424854",
          "exception": false,
          "start_time": "2021-03-17T14:55:24.352572",
          "status": "completed"
        },
        "tags": [],
        "id": "NGSlV54WSBGf"
      },
      "source": [
        "In this notebook, I performed an EDA on the 'Students Performance in Exams' dataset. I visualized the data using the Seaborn library. Descriptions of the Seaborn graphics are located under the headings. My comments on the graphics and results are below the code snippet."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.074377,
          "end_time": "2021-03-17T14:55:24.574246",
          "exception": false,
          "start_time": "2021-03-17T14:55:24.499869",
          "status": "completed"
        },
        "tags": [],
        "id": "7Ax5EZtwSBGg"
      },
      "source": [
        "Content:\n",
        "1. Exploratory Data Analysis - Explanation\n",
        "1. Seaborn - Explanation\n",
        "1. [Importing the Necessary Libraries](#0)\n",
        "1. [Read Datas & Explanation of Features & Information About Datasets](#1)\n",
        "   * [Variable Description](#2)\n",
        "   * [Univariate Variable Analysis](#3)\n",
        "     * [Categorical Variables](#4)\n",
        "     * [Numerical Variables](#5)\n",
        "1. [Basic Data Analysis](#6)\n",
        "   * [gender](#7)\n",
        "   * [race/ethnicity](#8)\n",
        "   * [parental level of education](#9)\n",
        "   * [lunch](#10)\n",
        "   * [test preparation score](#11)\n",
        "1. [Anomaly Detection](#12)\n",
        "1. [Visualization](#13)\n",
        "   * [Pie Plot](#14)\n",
        "   * [Violin Plot](#15)\n",
        "   * [Boxen Plot](#16)\n",
        "   * [Swarm Plot](#17)\n",
        "   * [Bar Plot](#18)\n",
        "   * [Joint Plot](#19)\n",
        "   * [Heatmap](#20)\n",
        "   * [Pair Plot](#21)\n",
        "   * [Box Plot](#22)\n",
        "   * [Scatter Plot](#23)\n",
        "     * [Scatter Plot with Marginal Ticks](#24)\n",
        "     * [Scatter Plot with Multiple Semantics](#25)\n",
        "   * [Stacked Histogram](#26)\n",
        "   * [Ridge Plot](#27)\n",
        "1. [Conclusion](#28)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.081048,
          "end_time": "2021-03-17T14:55:24.731185",
          "exception": false,
          "start_time": "2021-03-17T14:55:24.650137",
          "status": "completed"
        },
        "tags": [],
        "id": "CQ8FdjhMSBGi"
      },
      "source": [
        "## Exploratory Data Analysis\n",
        "\n",
        "In statistics, exploratory data analysis is an approach to analyzing data sets to summarize their main characteristics, often using statistical graphics and other data visualization methods. A statistical model can be used or not, but primarily EDA is for seeing what the data can tell us beyond the formal modeling or hypothesis testing task. Exploratory data analysis was promoted by John Tukey to encourage statisticians to explore the data, and possibly formulate hypotheses that could lead to new data collection and experiments. EDA is different from initial data analysis (IDA), which focuses more narrowly on checking assumptions required for model fitting and hypothesis testing, and handling missing values and making transformations of variables as needed. EDA encompasses IDA.\n",
        "\n",
        "Source: https://en.wikipedia.org/wiki/Exploratory_data_analysis"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.072044,
          "end_time": "2021-03-17T14:55:25.205619",
          "exception": false,
          "start_time": "2021-03-17T14:55:25.133575",
          "status": "completed"
        },
        "tags": [],
        "id": "CzdOjTvOSBGi"
      },
      "source": [
        "## Seaborn\n",
        "\n",
        "Seaborn is a statistical Python data visualization library based on the Matplotlib library. Seaborn offers users a high-level interface to make statistical visualizations.\n",
        "\n",
        "* A dataset-based API presented to examine the relationships between multiple variables in detail\n",
        "\n",
        "* Support for observing categorical variables and performing statistical operations on them\n",
        "\n",
        "* Supports multi-plot grids that enable to create complex visualizations\n",
        "\n",
        "* Univariate and bivariate visualizations for comparison between subsets\n",
        "\n",
        "* Wide color scale that makes visualization more understandable\n",
        "\n",
        "* Tools that adapt and visualize linear regression models for various types of independent and dependent variables\n",
        "\n",
        "* Functions that visualize matrices of data and use clustering algorithms to discover the structure in that matrix.\n",
        "\n",
        "* A function for displaying statistical time series data and uncertainties around the forecast with flexible prediction\n",
        "\n",
        "* High-level abstractions for structuring charts that allow you to easily create complex visualizations"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
        "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:25.650456Z",
          "iopub.status.busy": "2021-03-17T14:55:25.649774Z",
          "iopub.status.idle": "2021-03-17T14:55:25.657631Z",
          "shell.execute_reply": "2021-03-17T14:55:25.658061Z"
        },
        "papermill": {
          "duration": 0.086545,
          "end_time": "2021-03-17T14:55:25.658368",
          "exception": false,
          "start_time": "2021-03-17T14:55:25.571823",
          "status": "completed"
        },
        "tags": [],
        "id": "7ZSM4Zj2SBGk",
        "outputId": "a73f66ba-9f33-4202-9aba-5d72e9511605"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "/kaggle/input/students-performance-in-exams/StudentsPerformance.csv\n"
          ]
        }
      ],
      "source": [
        "# This Python 3 environment comes with many helpful analytics libraries installed\n",
        "# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n",
        "# For example, here's several helpful packages to load\n",
        "\n",
        "import numpy as np # linear algebra\n",
        "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n",
        "\n",
        "# Input data files are available in the read-only \"../input/\" directory\n",
        "# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n",
        "\n",
        "import os\n",
        "for dirname, _, filenames in os.walk('/kaggle/input'):\n",
        "    for filename in filenames:\n",
        "        print(os.path.join(dirname, filename))\n",
        "\n",
        "# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n",
        "# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.072622,
          "end_time": "2021-03-17T14:55:25.802782",
          "exception": false,
          "start_time": "2021-03-17T14:55:25.730160",
          "status": "completed"
        },
        "tags": [],
        "id": "NFKE5eVdSBGl"
      },
      "source": [
        "<a id = \"0\"></a><br>\n",
        "# Importing the Necessary Libraries"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:25.957694Z",
          "iopub.status.busy": "2021-03-17T14:55:25.957037Z",
          "iopub.status.idle": "2021-03-17T14:55:26.788039Z",
          "shell.execute_reply": "2021-03-17T14:55:26.787329Z"
        },
        "papermill": {
          "duration": 0.910849,
          "end_time": "2021-03-17T14:55:26.788184",
          "exception": false,
          "start_time": "2021-03-17T14:55:25.877335",
          "status": "completed"
        },
        "tags": [],
        "id": "GGlA9YrWSBGm"
      },
      "outputs": [],
      "source": [
        "import numpy as np \n",
        "import pandas as pd \n",
        "import seaborn as sns\n",
        "import matplotlib.pyplot as plt\n",
        "from collections import Counter\n",
        "%matplotlib inline\n",
        "import warnings\n",
        "warnings.filterwarnings('ignore') "
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.073813,
          "end_time": "2021-03-17T14:55:26.935871",
          "exception": false,
          "start_time": "2021-03-17T14:55:26.862058",
          "status": "completed"
        },
        "tags": [],
        "id": "US3wWsXJSBGm"
      },
      "source": [
        "<a id = \"1\"></a><br>\n",
        "# Read Datas & Explanation of Features & Information About Datasets"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:27.091724Z",
          "iopub.status.busy": "2021-03-17T14:55:27.091037Z",
          "iopub.status.idle": "2021-03-17T14:55:27.137348Z",
          "shell.execute_reply": "2021-03-17T14:55:27.136860Z"
        },
        "papermill": {
          "duration": 0.12726,
          "end_time": "2021-03-17T14:55:27.137548",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.010288",
          "status": "completed"
        },
        "tags": [],
        "id": "JuPqRffSSBGm",
        "outputId": "a64396c9-93c9-40c3-9d7e-8c4c2249a0a6"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>gender</th>\n",
              "      <th>race/ethnicity</th>\n",
              "      <th>parental level of education</th>\n",
              "      <th>lunch</th>\n",
              "      <th>test preparation course</th>\n",
              "      <th>math score</th>\n",
              "      <th>reading score</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>217</th>\n",
              "      <td>female</td>\n",
              "      <td>group C</td>\n",
              "      <td>high school</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>34</td>\n",
              "      <td>42</td>\n",
              "      <td>39</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>720</th>\n",
              "      <td>female</td>\n",
              "      <td>group C</td>\n",
              "      <td>some college</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>62</td>\n",
              "      <td>72</td>\n",
              "      <td>70</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>125</th>\n",
              "      <td>female</td>\n",
              "      <td>group B</td>\n",
              "      <td>high school</td>\n",
              "      <td>standard</td>\n",
              "      <td>none</td>\n",
              "      <td>87</td>\n",
              "      <td>95</td>\n",
              "      <td>86</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>120</th>\n",
              "      <td>female</td>\n",
              "      <td>group C</td>\n",
              "      <td>bachelor's degree</td>\n",
              "      <td>standard</td>\n",
              "      <td>completed</td>\n",
              "      <td>79</td>\n",
              "      <td>92</td>\n",
              "      <td>89</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>829</th>\n",
              "      <td>male</td>\n",
              "      <td>group B</td>\n",
              "      <td>some high school</td>\n",
              "      <td>standard</td>\n",
              "      <td>none</td>\n",
              "      <td>68</td>\n",
              "      <td>54</td>\n",
              "      <td>53</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>754</th>\n",
              "      <td>male</td>\n",
              "      <td>group C</td>\n",
              "      <td>associate's degree</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>58</td>\n",
              "      <td>55</td>\n",
              "      <td>53</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>914</th>\n",
              "      <td>female</td>\n",
              "      <td>group B</td>\n",
              "      <td>associate's degree</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>46</td>\n",
              "      <td>61</td>\n",
              "      <td>55</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>588</th>\n",
              "      <td>female</td>\n",
              "      <td>group C</td>\n",
              "      <td>some college</td>\n",
              "      <td>standard</td>\n",
              "      <td>none</td>\n",
              "      <td>54</td>\n",
              "      <td>64</td>\n",
              "      <td>65</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>874</th>\n",
              "      <td>female</td>\n",
              "      <td>group C</td>\n",
              "      <td>bachelor's degree</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>43</td>\n",
              "      <td>62</td>\n",
              "      <td>61</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>261</th>\n",
              "      <td>male</td>\n",
              "      <td>group C</td>\n",
              "      <td>some college</td>\n",
              "      <td>standard</td>\n",
              "      <td>completed</td>\n",
              "      <td>79</td>\n",
              "      <td>79</td>\n",
              "      <td>78</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     gender race/ethnicity parental level of education         lunch  \\\n",
              "217  female        group C                 high school  free/reduced   \n",
              "720  female        group C                some college  free/reduced   \n",
              "125  female        group B                 high school      standard   \n",
              "120  female        group C           bachelor's degree      standard   \n",
              "829    male        group B            some high school      standard   \n",
              "754    male        group C          associate's degree  free/reduced   \n",
              "914  female        group B          associate's degree  free/reduced   \n",
              "588  female        group C                some college      standard   \n",
              "874  female        group C           bachelor's degree  free/reduced   \n",
              "261    male        group C                some college      standard   \n",
              "\n",
              "    test preparation course  math score  reading score  writing score  \n",
              "217                    none          34             42             39  \n",
              "720                    none          62             72             70  \n",
              "125                    none          87             95             86  \n",
              "120               completed          79             92             89  \n",
              "829                    none          68             54             53  \n",
              "754                    none          58             55             53  \n",
              "914                    none          46             61             55  \n",
              "588                    none          54             64             65  \n",
              "874                    none          43             62             61  \n",
              "261               completed          79             79             78  "
            ]
          },
          "execution_count": 3,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset = pd.read_csv('/kaggle/input/students-performance-in-exams/StudentsPerformance.csv', encoding=\"windows-1252\")\n",
        "dataset.sample(10)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.074641,
          "end_time": "2021-03-17T14:55:27.287073",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.212432",
          "status": "completed"
        },
        "tags": [],
        "id": "SFpEO5-7SBGm"
      },
      "source": [
        "<a id = \"2\"></a><br>\n",
        "## Variable Description"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.073992,
          "end_time": "2021-03-17T14:55:27.436576",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.362584",
          "status": "completed"
        },
        "tags": [],
        "id": "x6meenJfSBGm"
      },
      "source": [
        "* gender \n",
        "* race/ethnicity \n",
        "* parental level of education \n",
        "* lunch\n",
        "* test preparation score \n",
        "* math score \n",
        "* reading score \n",
        "* writing score "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:27.592730Z",
          "iopub.status.busy": "2021-03-17T14:55:27.592023Z",
          "iopub.status.idle": "2021-03-17T14:55:27.602075Z",
          "shell.execute_reply": "2021-03-17T14:55:27.602739Z"
        },
        "papermill": {
          "duration": 0.09323,
          "end_time": "2021-03-17T14:55:27.602952",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.509722",
          "status": "completed"
        },
        "tags": [],
        "id": "rnW48sinSBGm",
        "outputId": "6a20158f-41c2-41c8-e6cc-bce4b685e1f0"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "<class 'pandas.core.frame.DataFrame'>\n",
            "RangeIndex: 1000 entries, 0 to 999\n",
            "Data columns (total 8 columns):\n",
            " #   Column                       Non-Null Count  Dtype \n",
            "---  ------                       --------------  ----- \n",
            " 0   gender                       1000 non-null   object\n",
            " 1   race/ethnicity               1000 non-null   object\n",
            " 2   parental level of education  1000 non-null   object\n",
            " 3   lunch                        1000 non-null   object\n",
            " 4   test preparation course      1000 non-null   object\n",
            " 5   math score                   1000 non-null   int64 \n",
            " 6   reading score                1000 non-null   int64 \n",
            " 7   writing score                1000 non-null   int64 \n",
            "dtypes: int64(3), object(5)\n",
            "memory usage: 62.6+ KB\n"
          ]
        }
      ],
      "source": [
        "dataset.info()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.074772,
          "end_time": "2021-03-17T14:55:27.753843",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.679071",
          "status": "completed"
        },
        "tags": [],
        "id": "7XB4QVTHSBGm"
      },
      "source": [
        "We have no NaN variable. So we do not have to handle missing values."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.075519,
          "end_time": "2021-03-17T14:55:27.905918",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.830399",
          "status": "completed"
        },
        "tags": [],
        "id": "he_ZElrFSBGn"
      },
      "source": [
        "<a id = \"3\"></a><br>\n",
        "## Univariate Variable Analysis\n",
        "\n",
        "*** Categorical Variables:** 'gender', 'race/ethnicity', 'parental level of education', 'lunch', 'test preparation course'\n",
        "\n",
        "*** Numerical Variables:** 'math score', 'reading score', 'writing score'."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.075197,
          "end_time": "2021-03-17T14:55:28.058239",
          "exception": false,
          "start_time": "2021-03-17T14:55:27.983042",
          "status": "completed"
        },
        "tags": [],
        "id": "rye9OXwuSBGn"
      },
      "source": [
        "<a id = \"4\"></a><br>\n",
        "### Categorical Variables"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:28.214798Z",
          "iopub.status.busy": "2021-03-17T14:55:28.213991Z",
          "iopub.status.idle": "2021-03-17T14:55:28.216488Z",
          "shell.execute_reply": "2021-03-17T14:55:28.216990Z"
        },
        "papermill": {
          "duration": 0.084237,
          "end_time": "2021-03-17T14:55:28.217150",
          "exception": false,
          "start_time": "2021-03-17T14:55:28.132913",
          "status": "completed"
        },
        "tags": [],
        "id": "rmxMLUaqSBGn"
      },
      "outputs": [],
      "source": [
        "def bar_plot(variable):\n",
        "    \"\"\"\n",
        "        input: variable ex: \"Sex\"\n",
        "        output: bar plot & value count\n",
        "    \"\"\"\n",
        "    # get feature\n",
        "    var = dataset[variable]\n",
        "    # count number of categorical variable(value/sample)\n",
        "    varValue = var.value_counts()\n",
        "    \n",
        "    # visualize\n",
        "    plt.figure(figsize = (9,3))\n",
        "    plt.bar(varValue.index, varValue)\n",
        "    plt.xticks(varValue.index, varValue.index.values)\n",
        "    plt.ylabel(\"Frequency\")\n",
        "    plt.title(variable)\n",
        "    plt.show()\n",
        "    print(\"{}:\\n{}\".format(variable,varValue))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:28.396881Z",
          "iopub.status.busy": "2021-03-17T14:55:28.395952Z",
          "iopub.status.idle": "2021-03-17T14:55:29.181101Z",
          "shell.execute_reply": "2021-03-17T14:55:29.180343Z"
        },
        "papermill": {
          "duration": 0.886253,
          "end_time": "2021-03-17T14:55:29.181276",
          "exception": false,
          "start_time": "2021-03-17T14:55:28.295023",
          "status": "completed"
        },
        "tags": [],
        "id": "DQDaaQvpSBGn",
        "outputId": "ee617387-c1ec-419f-b899-d42b8f80d3d5"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 9188 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "gender:\n",
            "female    518\n",
            "male      482\n",
            "Name: gender, dtype: int64\n"
          ]
        },
        {
          "data": {
            "image/png": "[encoded data, 11380 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "race/ethnicity:\n",
            "group C    319\n",
            "group D    262\n",
            "group B    190\n",
            "group E    140\n",
            "group A     89\n",
            "Name: race/ethnicity, dtype: int64\n"
          ]
        },
        {
          "data": {
            "image/png": "[encoded data, 15576 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "parental level of education:\n",
            "some college          226\n",
            "associate's degree    222\n",
            "high school           196\n",
            "some high school      179\n",
            "bachelor's degree     118\n",
            "master's degree        59\n",
            "Name: parental level of education, dtype: int64\n"
          ]
        },
        {
          "data": {
            "image/png": "[encoded data, 10424 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "lunch:\n",
            "standard        645\n",
            "free/reduced    355\n",
            "Name: lunch, dtype: int64\n"
          ]
        },
        {
          "data": {
            "image/png": "[encoded data, 12268 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "test preparation course:\n",
            "none         642\n",
            "completed    358\n",
            "Name: test preparation course, dtype: int64\n"
          ]
        }
      ],
      "source": [
        "sns.set_style('darkgrid')\n",
        "categorical_variables = ['gender', 'race/ethnicity', 'parental level of education', 'lunch', 'test preparation course']\n",
        "for c in categorical_variables:\n",
        "    bar_plot(c)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.080899,
          "end_time": "2021-03-17T14:55:29.343362",
          "exception": false,
          "start_time": "2021-03-17T14:55:29.262463",
          "status": "completed"
        },
        "tags": [],
        "id": "ZKEykrttSBGn"
      },
      "source": [
        "### Outlines\n",
        "\n",
        "* Female: 518, Male: 482; Gender distribution can be said to be balanced.\n",
        "* We see that Ethnicity is not balanced. 'group C' predominates.\n",
        "* We see that the education level of the parents is not evenly distributed. We see that the parents with a Master's degree are in the minority, and the ones with Some College are in the majority.\n",
        "* In the 'lunch' feature, it can be said that the 'standard' doubles the other.\n",
        "* We see that 642 students did not take test preparation courses, 358 of them did."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.081544,
          "end_time": "2021-03-17T14:55:29.544355",
          "exception": false,
          "start_time": "2021-03-17T14:55:29.462811",
          "status": "completed"
        },
        "tags": [],
        "id": "VBbByYgqSBGn"
      },
      "source": [
        "<a id = \"5\"></a><br>\n",
        "### Numerical Variables"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:29.716951Z",
          "iopub.status.busy": "2021-03-17T14:55:29.715994Z",
          "iopub.status.idle": "2021-03-17T14:55:29.719006Z",
          "shell.execute_reply": "2021-03-17T14:55:29.718380Z"
        },
        "papermill": {
          "duration": 0.093032,
          "end_time": "2021-03-17T14:55:29.719161",
          "exception": false,
          "start_time": "2021-03-17T14:55:29.626129",
          "status": "completed"
        },
        "tags": [],
        "id": "C3yXz4sTSBGn"
      },
      "outputs": [],
      "source": [
        "def plot_hist(variable):\n",
        "    plt.figure(figsize = (9,3))\n",
        "    plt.hist(dataset[variable], bins = 50)\n",
        "    plt.xlabel(variable)\n",
        "    plt.ylabel(\"Frequency\")\n",
        "    plt.title(\"{} distribution with hist\".format(variable))\n",
        "    plt.show()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:29.905955Z",
          "iopub.status.busy": "2021-03-17T14:55:29.903379Z",
          "iopub.status.idle": "2021-03-17T14:55:30.665487Z",
          "shell.execute_reply": "2021-03-17T14:55:30.664843Z"
        },
        "papermill": {
          "duration": 0.864778,
          "end_time": "2021-03-17T14:55:30.665635",
          "exception": false,
          "start_time": "2021-03-17T14:55:29.800857",
          "status": "completed"
        },
        "tags": [],
        "id": "mRZo5502SBGp",
        "outputId": "b38ea79a-cfca-4ba6-c649-a48beffc5f9c"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 13700 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "image/png": "[encoded data, 14276 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "image/png": "[encoded data, 14044 characters]\n",
            "text/plain": [
              "<Figure size 648x216 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "numerical_variables = ['math score', 'reading score', 'writing score']\n",
        "for n in numerical_variables:\n",
        "    plot_hist(n)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.083683,
          "end_time": "2021-03-17T14:55:30.833879",
          "exception": false,
          "start_time": "2021-03-17T14:55:30.750196",
          "status": "completed"
        },
        "tags": [],
        "id": "6FpNPf2WSBGq"
      },
      "source": [
        "### Outlines\n",
        "\n",
        "* In the 'math score', there is an accumulation in the range of 60-80.\n",
        "* There is no congestion in reading score like math. It can be said that the grade of the majority varies between 75-80.\n",
        "* The distribution in the 'writing score' feature is like in reading score."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.082363,
          "end_time": "2021-03-17T14:55:30.999481",
          "exception": false,
          "start_time": "2021-03-17T14:55:30.917118",
          "status": "completed"
        },
        "tags": [],
        "id": "uRHo0zhOSBGq"
      },
      "source": [
        "<a id = \"6\"></a><br>\n",
        "# Basic Data Analysis\n",
        "\n",
        "## gender X\n",
        "* math score\n",
        "* reading score\n",
        "* writing score\n",
        "\n",
        "## race/ethnicity X\n",
        "* math score\n",
        "* reading score\n",
        "* writing score\n",
        "\n",
        "## parental level of education\n",
        "* math score\n",
        "* reading score\n",
        "* writing score\n",
        "\n",
        "## lunch X\n",
        "* math score\n",
        "* reading score\n",
        "* writing score\n",
        "\n",
        "## test preparation course X\n",
        "* math score\n",
        "* reading score\n",
        "* writing score"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.08152,
          "end_time": "2021-03-17T14:55:31.164654",
          "exception": false,
          "start_time": "2021-03-17T14:55:31.083134",
          "status": "completed"
        },
        "tags": [],
        "id": "mhNM4QBgSBGq"
      },
      "source": [
        "<a id = \"7\"></a><br>\n",
        "## gender"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:31.342066Z",
          "iopub.status.busy": "2021-03-17T14:55:31.336982Z",
          "iopub.status.idle": "2021-03-17T14:55:31.346144Z",
          "shell.execute_reply": "2021-03-17T14:55:31.345543Z"
        },
        "papermill": {
          "duration": 0.099668,
          "end_time": "2021-03-17T14:55:31.346276",
          "exception": false,
          "start_time": "2021-03-17T14:55:31.246608",
          "status": "completed"
        },
        "tags": [],
        "id": "7PJghIK2SBGq",
        "outputId": "e2386b88-e5cc-4c17-b89c-4786b2faba36"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>gender</th>\n",
              "      <th>math score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>male</td>\n",
              "      <td>68.728216</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>female</td>\n",
              "      <td>63.633205</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   gender  math score\n",
              "1    male   68.728216\n",
              "0  female   63.633205"
            ]
          },
          "execution_count": 9,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"gender\",\"math score\"]].groupby([\"gender\"], as_index = False).mean().sort_values(by=\"math score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:31.527912Z",
          "iopub.status.busy": "2021-03-17T14:55:31.527108Z",
          "iopub.status.idle": "2021-03-17T14:55:31.531615Z",
          "shell.execute_reply": "2021-03-17T14:55:31.531019Z"
        },
        "papermill": {
          "duration": 0.102276,
          "end_time": "2021-03-17T14:55:31.531786",
          "exception": false,
          "start_time": "2021-03-17T14:55:31.429510",
          "status": "completed"
        },
        "tags": [],
        "id": "VKBQ9hk8SBGq",
        "outputId": "a72d0c23-7dc4-49e1-f2e8-d72215539a23"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>gender</th>\n",
              "      <th>reading score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>female</td>\n",
              "      <td>72.608108</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>male</td>\n",
              "      <td>65.473029</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   gender  reading score\n",
              "0  female      72.608108\n",
              "1    male      65.473029"
            ]
          },
          "execution_count": 10,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"gender\",\"reading score\"]].groupby([\"gender\"], as_index = False).mean().sort_values(by=\"reading score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:31.713736Z",
          "iopub.status.busy": "2021-03-17T14:55:31.713064Z",
          "iopub.status.idle": "2021-03-17T14:55:31.716970Z",
          "shell.execute_reply": "2021-03-17T14:55:31.716362Z"
        },
        "papermill": {
          "duration": 0.100691,
          "end_time": "2021-03-17T14:55:31.717099",
          "exception": false,
          "start_time": "2021-03-17T14:55:31.616408",
          "status": "completed"
        },
        "tags": [],
        "id": "LDSjXzdqSBGq",
        "outputId": "370a0c06-f40e-4c5c-958b-5d8c2827a9fc"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>gender</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>female</td>\n",
              "      <td>72.467181</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>male</td>\n",
              "      <td>63.311203</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   gender  writing score\n",
              "0  female      72.467181\n",
              "1    male      63.311203"
            ]
          },
          "execution_count": 11,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"gender\",\"writing score\"]].groupby([\"gender\"], as_index = False).mean().sort_values(by=\"writing score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:31.896487Z",
          "iopub.status.busy": "2021-03-17T14:55:31.895823Z",
          "iopub.status.idle": "2021-03-17T14:55:32.165623Z",
          "shell.execute_reply": "2021-03-17T14:55:32.166103Z"
        },
        "papermill": {
          "duration": 0.364745,
          "end_time": "2021-03-17T14:55:32.166263",
          "exception": false,
          "start_time": "2021-03-17T14:55:31.801518",
          "status": "completed"
        },
        "tags": [],
        "id": "CG7sXO-BSBGq",
        "outputId": "4950fd41-d2ba-4399-964b-f5871d717365"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 44784 characters]\n",
            "text/plain": [
              "<Figure size 1440x720 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "race_math = dataset[[\"gender\",\"math score\"]].groupby([\"gender\"], as_index = False).mean()\n",
        "race_writing = dataset[[\"gender\",\"writing score\"]].groupby([\"gender\"], as_index = False).mean()\n",
        "race_reading = dataset[[\"gender\",\"reading score\"]].groupby([\"gender\"], as_index = False).mean()\n",
        "\n",
        "plt.figure(figsize=(20,10))\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "plt.title('Math - Reading - Writing Scores according to Gender', fontweight='bold', size = 24)\n",
        "\n",
        "barWidth = 0.25\n",
        " \n",
        "bars1 = race_math['math score']\n",
        "bars2 = race_writing['writing score']\n",
        "bars3 = race_reading['reading score']\n",
        "\n",
        " \n",
        "r1 = np.arange(len(bars1))\n",
        "r2 = [x + barWidth for x in r1]\n",
        "r3 = [x + barWidth for x in r2]\n",
        "r4 = [x + barWidth for x in r3]\n",
        " \n",
        "plt.bar(r1, bars1, color='blue', width=barWidth, edgecolor='white', label='math score', yerr=0.3,ecolor=\"black\",capsize=10)\n",
        "plt.bar(r2, bars2, color='#557f2d', width=barWidth, edgecolor='white', label='writing score', yerr=0.5,ecolor=\"black\",capsize=10, alpha = .50)\n",
        "plt.bar(r3, bars3, color='red', width=barWidth, edgecolor='white', label='reading score', yerr=0.5,ecolor=\"black\",capsize=10, hatch = '-')\n",
        "\n",
        "modelNames = race_math['gender']\n",
        "    \n",
        "plt.xlabel('Gender', fontweight='bold', size = 24)\n",
        "plt.ylabel('Scores', fontweight='bold', size = 24)\n",
        "plt.xticks([r + barWidth for r in range(len(bars1))], modelNames, rotation = 0, size = 24)\n",
        "plt.legend()\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.085994,
          "end_time": "2021-03-17T14:55:32.338037",
          "exception": false,
          "start_time": "2021-03-17T14:55:32.252043",
          "status": "completed"
        },
        "tags": [],
        "id": "oa_hbzdvSBGr"
      },
      "source": [
        "### Outline:\n",
        "\n",
        "**!!! Except for the math score, females have higher averages. !!!**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.085363,
          "end_time": "2021-03-17T14:55:32.509244",
          "exception": false,
          "start_time": "2021-03-17T14:55:32.423881",
          "status": "completed"
        },
        "tags": [],
        "id": "U-c7pC2_SBGr"
      },
      "source": [
        "<a id = \"8\"></a><br>\n",
        "## race/ethnicity"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:32.694412Z",
          "iopub.status.busy": "2021-03-17T14:55:32.689073Z",
          "iopub.status.idle": "2021-03-17T14:55:32.698810Z",
          "shell.execute_reply": "2021-03-17T14:55:32.698228Z"
        },
        "papermill": {
          "duration": 0.103946,
          "end_time": "2021-03-17T14:55:32.698939",
          "exception": false,
          "start_time": "2021-03-17T14:55:32.594993",
          "status": "completed"
        },
        "tags": [],
        "id": "r85xtxDBSBGr",
        "outputId": "01880d62-d8bd-40a6-84ce-66cf48d0e9fb"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>race/ethnicity</th>\n",
              "      <th>math score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>group E</td>\n",
              "      <td>73.821429</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>group D</td>\n",
              "      <td>67.362595</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>group C</td>\n",
              "      <td>64.463950</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>group B</td>\n",
              "      <td>63.452632</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>group A</td>\n",
              "      <td>61.629213</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  race/ethnicity  math score\n",
              "4        group E   73.821429\n",
              "3        group D   67.362595\n",
              "2        group C   64.463950\n",
              "1        group B   63.452632\n",
              "0        group A   61.629213"
            ]
          },
          "execution_count": 13,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"race/ethnicity\",\"math score\"]].groupby([\"race/ethnicity\"], as_index = False).mean().sort_values(by=\"math score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:32.882430Z",
          "iopub.status.busy": "2021-03-17T14:55:32.876327Z",
          "iopub.status.idle": "2021-03-17T14:55:32.886339Z",
          "shell.execute_reply": "2021-03-17T14:55:32.885866Z"
        },
        "papermill": {
          "duration": 0.103173,
          "end_time": "2021-03-17T14:55:32.886466",
          "exception": false,
          "start_time": "2021-03-17T14:55:32.783293",
          "status": "completed"
        },
        "tags": [],
        "id": "SuuGBT5gSBGr",
        "outputId": "4006efeb-ff93-4e3f-8bea-28f3c587dd86"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>race/ethnicity</th>\n",
              "      <th>reading score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>group E</td>\n",
              "      <td>73.028571</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>group D</td>\n",
              "      <td>70.030534</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>group C</td>\n",
              "      <td>69.103448</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>group B</td>\n",
              "      <td>67.352632</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>group A</td>\n",
              "      <td>64.674157</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  race/ethnicity  reading score\n",
              "4        group E      73.028571\n",
              "3        group D      70.030534\n",
              "2        group C      69.103448\n",
              "1        group B      67.352632\n",
              "0        group A      64.674157"
            ]
          },
          "execution_count": 14,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"race/ethnicity\",\"reading score\"]].groupby([\"race/ethnicity\"], as_index = False).mean().sort_values(by=\"reading score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:33.074653Z",
          "iopub.status.busy": "2021-03-17T14:55:33.074027Z",
          "iopub.status.idle": "2021-03-17T14:55:33.078117Z",
          "shell.execute_reply": "2021-03-17T14:55:33.078589Z"
        },
        "papermill": {
          "duration": 0.105227,
          "end_time": "2021-03-17T14:55:33.078756",
          "exception": false,
          "start_time": "2021-03-17T14:55:32.973529",
          "status": "completed"
        },
        "tags": [],
        "id": "7m_bM0QBSBGr",
        "outputId": "22a0a54f-5950-4350-b70d-0f1b41dc0d95"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>race/ethnicity</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>group E</td>\n",
              "      <td>71.407143</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>group D</td>\n",
              "      <td>70.145038</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>group C</td>\n",
              "      <td>67.827586</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>group B</td>\n",
              "      <td>65.600000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>group A</td>\n",
              "      <td>62.674157</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  race/ethnicity  writing score\n",
              "4        group E      71.407143\n",
              "3        group D      70.145038\n",
              "2        group C      67.827586\n",
              "1        group B      65.600000\n",
              "0        group A      62.674157"
            ]
          },
          "execution_count": 15,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"race/ethnicity\",\"writing score\"]].groupby([\"race/ethnicity\"], as_index = False).mean().sort_values(by=\"writing score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:33.271850Z",
          "iopub.status.busy": "2021-03-17T14:55:33.267365Z",
          "iopub.status.idle": "2021-03-17T14:55:33.570746Z",
          "shell.execute_reply": "2021-03-17T14:55:33.570085Z"
        },
        "papermill": {
          "duration": 0.404259,
          "end_time": "2021-03-17T14:55:33.570889",
          "exception": false,
          "start_time": "2021-03-17T14:55:33.166630",
          "status": "completed"
        },
        "tags": [],
        "id": "SOVAEC0wSBGr",
        "outputId": "8269dce1-d19f-4c8c-96af-11050862012e"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 50888 characters]\n",
            "text/plain": [
              "<Figure size 1440x720 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "race_math = dataset[[\"race/ethnicity\",\"math score\"]].groupby([\"race/ethnicity\"], as_index = False).mean()\n",
        "race_writing = dataset[[\"race/ethnicity\",\"writing score\"]].groupby([\"race/ethnicity\"], as_index = False).mean()\n",
        "race_reading = dataset[[\"race/ethnicity\",\"reading score\"]].groupby([\"race/ethnicity\"], as_index = False).mean()\n",
        "\n",
        "plt.figure(figsize=(20,10))\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "plt.title('Math - Reading - Writing Scores according to Race/Ethnicity', fontweight='bold', size = 24)\n",
        "\n",
        "barWidth = 0.25\n",
        " \n",
        "bars1 = race_math['math score']\n",
        "bars2 = race_writing['writing score']\n",
        "bars3 = race_reading['reading score']\n",
        " \n",
        "r1 = np.arange(len(bars1))\n",
        "r2 = [x + barWidth for x in r1]\n",
        "r3 = [x + barWidth for x in r2]\n",
        " \n",
        "plt.bar(r1, bars1, color='blue', width=barWidth, edgecolor='white', label='math score', yerr=0.5,ecolor=\"black\",capsize=10)\n",
        "plt.bar(r2, bars2, color='#557f2d', width=barWidth, edgecolor='white', label='writing score', yerr=0.5,ecolor=\"black\",capsize=10, alpha = .50)\n",
        "plt.bar(r3, bars3, color='red', width=barWidth, edgecolor='white', label='reading score', yerr=0.5,ecolor=\"black\",capsize=10, hatch = '-')\n",
        " \n",
        "modelNames = race_math['race/ethnicity']\n",
        "    \n",
        "plt.xlabel('Race/ethnicity', fontweight='bold', size = 24)\n",
        "plt.ylabel('Scores', fontweight='bold', size = 24)\n",
        "plt.xticks([r + barWidth for r in range(len(bars1))], modelNames, rotation = 0, size = 24)\n",
        " \n",
        "plt.legend()\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.087567,
          "end_time": "2021-03-17T14:55:33.749053",
          "exception": false,
          "start_time": "2021-03-17T14:55:33.661486",
          "status": "completed"
        },
        "tags": [],
        "id": "l5cMrZRYSBGr"
      },
      "source": [
        "### Outline:\n",
        "\n",
        "race/ethnicity:\n",
        "\n",
        "group C    319\n",
        "\n",
        "group D    262\n",
        "\n",
        "group B    190\n",
        "\n",
        "group E    140\n",
        "\n",
        "group A     89\n",
        "\n",
        "**!!! When the scores are evaluated by race, the rankings do not change. 'group E' has the highest scores while 'group A' has the lowest scores. However, the number of samples should also be considered here. 'group A' has the least samples. 'group E' has the least sample after A. !!!**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.088169,
          "end_time": "2021-03-17T14:55:33.925760",
          "exception": false,
          "start_time": "2021-03-17T14:55:33.837591",
          "status": "completed"
        },
        "tags": [],
        "id": "90tWWBDUSBGs"
      },
      "source": [
        "<a id = \"9\"></a><br>\n",
        "## parental level of education"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:34.120031Z",
          "iopub.status.busy": "2021-03-17T14:55:34.119335Z",
          "iopub.status.idle": "2021-03-17T14:55:34.124766Z",
          "shell.execute_reply": "2021-03-17T14:55:34.124146Z"
        },
        "papermill": {
          "duration": 0.109957,
          "end_time": "2021-03-17T14:55:34.124904",
          "exception": false,
          "start_time": "2021-03-17T14:55:34.014947",
          "status": "completed"
        },
        "tags": [],
        "id": "5Sg10DGeSBGs",
        "outputId": "cc38df71-813d-43cf-fb92-e62e258af40b"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>parental level of education</th>\n",
              "      <th>math score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>master's degree</td>\n",
              "      <td>69.745763</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>bachelor's degree</td>\n",
              "      <td>69.389831</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>associate's degree</td>\n",
              "      <td>67.882883</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>some college</td>\n",
              "      <td>67.128319</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>some high school</td>\n",
              "      <td>63.497207</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>high school</td>\n",
              "      <td>62.137755</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  parental level of education  math score\n",
              "3             master's degree   69.745763\n",
              "1           bachelor's degree   69.389831\n",
              "0          associate's degree   67.882883\n",
              "4                some college   67.128319\n",
              "5            some high school   63.497207\n",
              "2                 high school   62.137755"
            ]
          },
          "execution_count": 17,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"parental level of education\",\"math score\"]].groupby([\"parental level of education\"], as_index = False).mean().sort_values(by=\"math score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:34.321306Z",
          "iopub.status.busy": "2021-03-17T14:55:34.320418Z",
          "iopub.status.idle": "2021-03-17T14:55:34.324400Z",
          "shell.execute_reply": "2021-03-17T14:55:34.323915Z"
        },
        "papermill": {
          "duration": 0.108384,
          "end_time": "2021-03-17T14:55:34.324552",
          "exception": false,
          "start_time": "2021-03-17T14:55:34.216168",
          "status": "completed"
        },
        "tags": [],
        "id": "zeia_3lTSBGs",
        "outputId": "c04dfb0e-22a3-426e-c2b2-978d8eb8f52d"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>parental level of education</th>\n",
              "      <th>reading score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>master's degree</td>\n",
              "      <td>75.372881</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>bachelor's degree</td>\n",
              "      <td>73.000000</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>associate's degree</td>\n",
              "      <td>70.927928</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>some college</td>\n",
              "      <td>69.460177</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>some high school</td>\n",
              "      <td>66.938547</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>high school</td>\n",
              "      <td>64.704082</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  parental level of education  reading score\n",
              "3             master's degree      75.372881\n",
              "1           bachelor's degree      73.000000\n",
              "0          associate's degree      70.927928\n",
              "4                some college      69.460177\n",
              "5            some high school      66.938547\n",
              "2                 high school      64.704082"
            ]
          },
          "execution_count": 18,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"parental level of education\",\"reading score\"]].groupby([\"parental level of education\"], as_index = False).mean().sort_values(by=\"reading score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:34.563688Z",
          "iopub.status.busy": "2021-03-17T14:55:34.558304Z",
          "iopub.status.idle": "2021-03-17T14:55:34.567205Z",
          "shell.execute_reply": "2021-03-17T14:55:34.567668Z"
        },
        "papermill": {
          "duration": 0.152512,
          "end_time": "2021-03-17T14:55:34.567848",
          "exception": false,
          "start_time": "2021-03-17T14:55:34.415336",
          "status": "completed"
        },
        "tags": [],
        "id": "wgwBA8bgSBGs",
        "outputId": "7feee777-d783-4ecc-8142-f84c1bbdc589"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>parental level of education</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>master's degree</td>\n",
              "      <td>75.677966</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>bachelor's degree</td>\n",
              "      <td>73.381356</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>associate's degree</td>\n",
              "      <td>69.896396</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>some college</td>\n",
              "      <td>68.840708</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>some high school</td>\n",
              "      <td>64.888268</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>high school</td>\n",
              "      <td>62.448980</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  parental level of education  writing score\n",
              "3             master's degree      75.677966\n",
              "1           bachelor's degree      73.381356\n",
              "0          associate's degree      69.896396\n",
              "4                some college      68.840708\n",
              "5            some high school      64.888268\n",
              "2                 high school      62.448980"
            ]
          },
          "execution_count": 19,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"parental level of education\",\"writing score\"]].groupby([\"parental level of education\"], as_index = False).mean().sort_values(by=\"writing score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:34.765855Z",
          "iopub.status.busy": "2021-03-17T14:55:34.764159Z",
          "iopub.status.idle": "2021-03-17T14:55:35.081418Z",
          "shell.execute_reply": "2021-03-17T14:55:35.080897Z"
        },
        "papermill": {
          "duration": 0.421984,
          "end_time": "2021-03-17T14:55:35.081575",
          "exception": false,
          "start_time": "2021-03-17T14:55:34.659591",
          "status": "completed"
        },
        "tags": [],
        "id": "clA8-B27SBGt",
        "outputId": "67b29665-f74e-41a6-c4b0-76ecf8e22c23"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 60388 characters]\n",
            "text/plain": [
              "<Figure size 1440x720 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "race_math = dataset[[\"parental level of education\",\"math score\"]].groupby([\"parental level of education\"], as_index = False).mean()\n",
        "race_writing = dataset[[\"parental level of education\",\"writing score\"]].groupby([\"parental level of education\"], as_index = False).mean()\n",
        "race_reading = dataset[[\"parental level of education\",\"reading score\"]].groupby([\"parental level of education\"], as_index = False).mean()\n",
        "\n",
        "plt.figure(figsize=(20,10))\n",
        "plt.title('Math - Reading - Writing Scores according to Parental Level of Education', fontweight='bold', size = 24)\n",
        "\n",
        "barWidth = 0.25\n",
        " \n",
        "bars1 = race_math['math score']\n",
        "bars2 = race_writing['writing score']\n",
        "bars3 = race_reading['reading score']\n",
        " \n",
        "r1 = np.arange(len(bars1))\n",
        "r2 = [x + barWidth for x in r1]\n",
        "r3 = [x + barWidth for x in r2]\n",
        " \n",
        "plt.bar(r1, bars1, color='blue', width=barWidth, edgecolor='white', label='math score', yerr=0.5,ecolor=\"black\",capsize=10)\n",
        "plt.bar(r2, bars2, color='#557f2d', width=barWidth, edgecolor='white', label='writing score', yerr=0.5,ecolor=\"black\",capsize=10, alpha = .50)\n",
        "plt.bar(r3, bars3, color='red', width=barWidth, edgecolor='white', label='reading score', yerr=0.5,ecolor=\"black\",capsize=10, hatch = '-')\n",
        " \n",
        "modelNames = race_math['parental level of education']\n",
        "    \n",
        "plt.xlabel('Parental Level of Education', fontweight='bold', size = 24)\n",
        "plt.ylabel('Scores', fontweight='bold', size = 24)\n",
        "plt.xticks([r + barWidth for r in range(len(bars1))], modelNames, rotation = 0, size = 15)\n",
        " \n",
        "plt.legend()\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.091682,
          "end_time": "2021-03-17T14:55:35.267983",
          "exception": false,
          "start_time": "2021-03-17T14:55:35.176301",
          "status": "completed"
        },
        "tags": [],
        "id": "ugwIrXadSBGt"
      },
      "source": [
        "### Outline:\n",
        "\n",
        "parental level of education:\n",
        "\n",
        "some college          226\n",
        "\n",
        "associate's degree    222\n",
        "\n",
        "high school           196\n",
        "\n",
        "some high school      179\n",
        "\n",
        "bachelor's degree     118\n",
        "\n",
        "master's degree        59\n",
        "\n",
        "**!!! When parental education levels are evaluated; It is seen that the average of students whose parents have completed a Master is the highest in all tests. The lowest averages are those whose parents have High school degree. However, here, too, it is necessary to consider the size of the sample set. While there are 59 samples in Master's Degree, there are 196 samples in the 'High School' set. !!!**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.089416,
          "end_time": "2021-03-17T14:55:35.448438",
          "exception": false,
          "start_time": "2021-03-17T14:55:35.359022",
          "status": "completed"
        },
        "tags": [],
        "id": "FzB5y81NSBGt"
      },
      "source": [
        "<a id = \"10\"></a><br>\n",
        "## lunch"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:35.646056Z",
          "iopub.status.busy": "2021-03-17T14:55:35.639536Z",
          "iopub.status.idle": "2021-03-17T14:55:35.650198Z",
          "shell.execute_reply": "2021-03-17T14:55:35.649658Z"
        },
        "papermill": {
          "duration": 0.110571,
          "end_time": "2021-03-17T14:55:35.650389",
          "exception": false,
          "start_time": "2021-03-17T14:55:35.539818",
          "status": "completed"
        },
        "tags": [],
        "id": "IJIDCfO1SBGt",
        "outputId": "35608c55-c1cb-403f-c8e9-556fb5188ee0"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>lunch</th>\n",
              "      <th>math score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>standard</td>\n",
              "      <td>70.034109</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>free/reduced</td>\n",
              "      <td>58.921127</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "          lunch  math score\n",
              "1      standard   70.034109\n",
              "0  free/reduced   58.921127"
            ]
          },
          "execution_count": 21,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"lunch\",\"math score\"]].groupby([\"lunch\"], as_index = False).mean().sort_values(by=\"math score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:35.851885Z",
          "iopub.status.busy": "2021-03-17T14:55:35.846240Z",
          "iopub.status.idle": "2021-03-17T14:55:35.855398Z",
          "shell.execute_reply": "2021-03-17T14:55:35.855886Z"
        },
        "papermill": {
          "duration": 0.111614,
          "end_time": "2021-03-17T14:55:35.856050",
          "exception": false,
          "start_time": "2021-03-17T14:55:35.744436",
          "status": "completed"
        },
        "tags": [],
        "id": "u7q5tw-NSBGt",
        "outputId": "ffaf3362-1b53-4c5c-b46e-3fbd7acb53e9"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>lunch</th>\n",
              "      <th>reading score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>standard</td>\n",
              "      <td>71.654264</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>free/reduced</td>\n",
              "      <td>64.653521</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "          lunch  reading score\n",
              "1      standard      71.654264\n",
              "0  free/reduced      64.653521"
            ]
          },
          "execution_count": 22,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"lunch\",\"reading score\"]].groupby([\"lunch\"], as_index = False).mean().sort_values(by=\"reading score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:36.046979Z",
          "iopub.status.busy": "2021-03-17T14:55:36.046376Z",
          "iopub.status.idle": "2021-03-17T14:55:36.060035Z",
          "shell.execute_reply": "2021-03-17T14:55:36.060585Z"
        },
        "papermill": {
          "duration": 0.111702,
          "end_time": "2021-03-17T14:55:36.060771",
          "exception": false,
          "start_time": "2021-03-17T14:55:35.949069",
          "status": "completed"
        },
        "tags": [],
        "id": "cZwWN0RzSBGt",
        "outputId": "60a7b0e0-7dd8-4a2f-94da-e8f20e2b2dc4"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>lunch</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>standard</td>\n",
              "      <td>70.823256</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>free/reduced</td>\n",
              "      <td>63.022535</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "          lunch  writing score\n",
              "1      standard      70.823256\n",
              "0  free/reduced      63.022535"
            ]
          },
          "execution_count": 23,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"lunch\",\"writing score\"]].groupby([\"lunch\"], as_index = False).mean().sort_values(by=\"writing score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:36.250614Z",
          "iopub.status.busy": "2021-03-17T14:55:36.249632Z",
          "iopub.status.idle": "2021-03-17T14:55:36.511254Z",
          "shell.execute_reply": "2021-03-17T14:55:36.510752Z"
        },
        "papermill": {
          "duration": 0.357681,
          "end_time": "2021-03-17T14:55:36.511414",
          "exception": false,
          "start_time": "2021-03-17T14:55:36.153733",
          "status": "completed"
        },
        "tags": [],
        "id": "NAKrmIM_SBGt",
        "outputId": "e3a0d383-051e-408a-b5e6-1c825764ea54"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 45124 characters]\n",
            "text/plain": [
              "<Figure size 1440x720 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "race_math = dataset[[\"lunch\",\"math score\"]].groupby([\"lunch\"], as_index = False).mean()\n",
        "race_writing = dataset[[\"lunch\",\"writing score\"]].groupby([\"lunch\"], as_index = False).mean()\n",
        "race_reading = dataset[[\"lunch\",\"reading score\"]].groupby([\"lunch\"], as_index = False).mean()\n",
        "\n",
        "plt.figure(figsize=(20,10))\n",
        "plt.title('Math - Reading - Writing Scores according to Lunch', fontweight='bold', size = 24)\n",
        "\n",
        "barWidth = 0.25\n",
        " \n",
        "bars1 = race_math['math score']\n",
        "bars2 = race_writing['writing score']\n",
        "bars3 = race_reading['reading score']\n",
        " \n",
        "r1 = np.arange(len(bars1))\n",
        "r2 = [x + barWidth for x in r1]\n",
        "r3 = [x + barWidth for x in r2]\n",
        " \n",
        "plt.bar(r1, bars1, color='blue', width=barWidth, edgecolor='white', label='math score', yerr=0.5,ecolor=\"black\",capsize=10)\n",
        "plt.bar(r2, bars2, color='#557f2d', width=barWidth, edgecolor='white', label='writing score', yerr=0.5,ecolor=\"black\",capsize=10, alpha = .50)\n",
        "plt.bar(r3, bars3, color='red', width=barWidth, edgecolor='white', label='reading score', yerr=0.5,ecolor=\"black\",capsize=10, hatch = '-')\n",
        " \n",
        "modelNames = race_math['lunch']\n",
        "    \n",
        "plt.xlabel('Lunch', fontweight='bold', size = 24)\n",
        "plt.ylabel('Scores', fontweight='bold', size = 24)\n",
        "plt.xticks([r + barWidth for r in range(len(bars1))], modelNames, rotation = 0, size = 24)\n",
        " \n",
        "plt.legend()\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.096301,
          "end_time": "2021-03-17T14:55:36.702280",
          "exception": false,
          "start_time": "2021-03-17T14:55:36.605979",
          "status": "completed"
        },
        "tags": [],
        "id": "Caf316mCSBGt"
      },
      "source": [
        "### Outline:\n",
        "\n",
        "lunch:\n",
        "\n",
        "standard        645\n",
        "\n",
        "free/reduced    355\n",
        "\n",
        "**!!! The 'standard' ones in the 'lunch' feature appear to be more successful than the 'free/reduced' ones. It seems that the biggest difference is in the 'math score'. !!!**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.093917,
          "end_time": "2021-03-17T14:55:36.892339",
          "exception": false,
          "start_time": "2021-03-17T14:55:36.798422",
          "status": "completed"
        },
        "tags": [],
        "id": "Yb5XZfJTSBGt"
      },
      "source": [
        "<a id = \"11\"></a><br>\n",
        "## test preparation course"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:37.100724Z",
          "iopub.status.busy": "2021-03-17T14:55:37.100031Z",
          "iopub.status.idle": "2021-03-17T14:55:37.103702Z",
          "shell.execute_reply": "2021-03-17T14:55:37.103180Z"
        },
        "papermill": {
          "duration": 0.114378,
          "end_time": "2021-03-17T14:55:37.103839",
          "exception": false,
          "start_time": "2021-03-17T14:55:36.989461",
          "status": "completed"
        },
        "tags": [],
        "id": "sHKDTNecSBGt",
        "outputId": "6ae7c3e0-ce9a-4b6e-87c4-4c29d392345b"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>test preparation course</th>\n",
              "      <th>math score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>completed</td>\n",
              "      <td>69.695531</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>none</td>\n",
              "      <td>64.077882</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  test preparation course  math score\n",
              "0               completed   69.695531\n",
              "1                    none   64.077882"
            ]
          },
          "execution_count": 25,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"test preparation course\",\"math score\"]].groupby([\"test preparation course\"], as_index = False).mean().sort_values(by=\"math score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:37.303688Z",
          "iopub.status.busy": "2021-03-17T14:55:37.302981Z",
          "iopub.status.idle": "2021-03-17T14:55:37.316028Z",
          "shell.execute_reply": "2021-03-17T14:55:37.316522Z"
        },
        "papermill": {
          "duration": 0.114598,
          "end_time": "2021-03-17T14:55:37.316723",
          "exception": false,
          "start_time": "2021-03-17T14:55:37.202125",
          "status": "completed"
        },
        "tags": [],
        "id": "s3mP2ltISBGt",
        "outputId": "6d632a66-52fd-4aa0-b19f-1a4e8964523d"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>test preparation course</th>\n",
              "      <th>reading score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>completed</td>\n",
              "      <td>73.893855</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>none</td>\n",
              "      <td>66.534268</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  test preparation course  reading score\n",
              "0               completed      73.893855\n",
              "1                    none      66.534268"
            ]
          },
          "execution_count": 26,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"test preparation course\",\"reading score\"]].groupby([\"test preparation course\"], as_index = False).mean().sort_values(by=\"reading score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:37.513082Z",
          "iopub.status.busy": "2021-03-17T14:55:37.512508Z",
          "iopub.status.idle": "2021-03-17T14:55:37.525326Z",
          "shell.execute_reply": "2021-03-17T14:55:37.525926Z"
        },
        "papermill": {
          "duration": 0.111151,
          "end_time": "2021-03-17T14:55:37.526090",
          "exception": false,
          "start_time": "2021-03-17T14:55:37.414939",
          "status": "completed"
        },
        "tags": [],
        "id": "mzOESwZRSBGu",
        "outputId": "cf2f0199-40dc-4828-cf5e-b3fc26d64aac"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>test preparation course</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>completed</td>\n",
              "      <td>74.418994</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>none</td>\n",
              "      <td>64.504673</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "  test preparation course  writing score\n",
              "0               completed      74.418994\n",
              "1                    none      64.504673"
            ]
          },
          "execution_count": 27,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset[[\"test preparation course\",\"writing score\"]].groupby([\"test preparation course\"], as_index = False).mean().sort_values(by=\"writing score\",ascending = False)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:37.738559Z",
          "iopub.status.busy": "2021-03-17T14:55:37.735285Z",
          "iopub.status.idle": "2021-03-17T14:55:37.989108Z",
          "shell.execute_reply": "2021-03-17T14:55:37.988447Z"
        },
        "papermill": {
          "duration": 0.369595,
          "end_time": "2021-03-17T14:55:37.989248",
          "exception": false,
          "start_time": "2021-03-17T14:55:37.619653",
          "status": "completed"
        },
        "tags": [],
        "id": "pmVbgGCpSBGu",
        "outputId": "21905e22-31aa-46b5-c57a-9c367427cbb8"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 53660 characters]\n",
            "text/plain": [
              "<Figure size 1440x720 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "race_math = dataset[[\"test preparation course\",\"math score\"]].groupby([\"test preparation course\"], as_index = False).mean()\n",
        "race_writing = dataset[[\"test preparation course\",\"writing score\"]].groupby([\"test preparation course\"], as_index = False).mean()\n",
        "race_reading = dataset[[\"test preparation course\",\"reading score\"]].groupby([\"test preparation course\"], as_index = False).mean()\n",
        "\n",
        "plt.figure(figsize=(20,10))\n",
        "plt.title('Math - Reading - Writing Scores according to Test Preparation Course', fontweight='bold', size = 24)\n",
        "\n",
        "barWidth = 0.25\n",
        " \n",
        "bars1 = race_math['math score']\n",
        "bars2 = race_writing['writing score']\n",
        "bars3 = race_reading['reading score']\n",
        " \n",
        "r1 = np.arange(len(bars1))\n",
        "r2 = [x + barWidth for x in r1]\n",
        "r3 = [x + barWidth for x in r2]\n",
        " \n",
        "plt.bar(r1, bars1, color='blue', width=barWidth, edgecolor='white', label='math score', yerr=0.5,ecolor=\"black\",capsize=10)\n",
        "plt.bar(r2, bars2, color='#557f2d', width=barWidth, edgecolor='white', label='writing score', yerr=0.5,ecolor=\"black\",capsize=10, alpha = .50)\n",
        "plt.bar(r3, bars3, color='red', width=barWidth, edgecolor='white', label='reading score', yerr=0.5,ecolor=\"black\",capsize=10, hatch = '-')\n",
        " \n",
        "modelNames = race_math['test preparation course']\n",
        "    \n",
        "plt.xlabel('Test Preparation Course', fontweight='bold', size = 24)\n",
        "plt.ylabel('Scores', fontweight='bold', size = 24)\n",
        "plt.xticks([r + barWidth for r in range(len(bars1))], modelNames, rotation = 0, size = 24)\n",
        " \n",
        "plt.legend()\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.096673,
          "end_time": "2021-03-17T14:55:38.187014",
          "exception": false,
          "start_time": "2021-03-17T14:55:38.090341",
          "status": "completed"
        },
        "tags": [],
        "id": "9dDx-YHVSBGu"
      },
      "source": [
        "### Outline:\n",
        "\n",
        "test preparation course:\n",
        "\n",
        "none         642\n",
        "\n",
        "completed    358\n",
        "\n",
        "**!!! It seems that those who complete the test preparation course are more successful than those who do not. !!!**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.098766,
          "end_time": "2021-03-17T14:55:38.384304",
          "exception": false,
          "start_time": "2021-03-17T14:55:38.285538",
          "status": "completed"
        },
        "tags": [],
        "id": "NWbQt8l6SBGu"
      },
      "source": [
        "<a id = \"12\"></a><br>\n",
        "# Anomaly Detection\n",
        "\n",
        "Anomaly is one that differs / deviates significantly from other observations in the same sample. An anomaly detection pattern produces two different results. The first is a categorical tag for whether the observation is abnormal or not; the second is a score or trust value. Score carries more information than the label. Because it also tells us how abnormal the observation is. The tag just tells you if it's abnormal. While labeling is more common in supervised methods, the score is more common in unsupervised and semisupervised methods."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:38.591690Z",
          "iopub.status.busy": "2021-03-17T14:55:38.591024Z",
          "iopub.status.idle": "2021-03-17T14:55:38.593752Z",
          "shell.execute_reply": "2021-03-17T14:55:38.594249Z"
        },
        "papermill": {
          "duration": 0.110679,
          "end_time": "2021-03-17T14:55:38.594445",
          "exception": false,
          "start_time": "2021-03-17T14:55:38.483766",
          "status": "completed"
        },
        "tags": [],
        "id": "wmZ7XKnsSBGu"
      },
      "outputs": [],
      "source": [
        "#This code is retrieved from here: https://www.kaggle.com/kanncaa1/dataiteam-titanic-eda#Introduction\n",
        "\n",
        "def detect_outliers(df,features):\n",
        "    outlier_indices = []\n",
        "    \n",
        "    for c in features:\n",
        "        # 1st quartile\n",
        "        Q1 = np.percentile(df[c],25)\n",
        "        # 3rd quartile\n",
        "        Q3 = np.percentile(df[c],75)\n",
        "        # IQR\n",
        "        IQR = Q3 - Q1\n",
        "        # Outlier step\n",
        "        outlier_step = IQR * 1.5\n",
        "        # detect outlier and their indeces\n",
        "        outlier_list_col = df[(df[c] < Q1 - outlier_step) | (df[c] > Q3 + outlier_step)].index\n",
        "        # store indeces\n",
        "        outlier_indices.extend(outlier_list_col)\n",
        "    \n",
        "    outlier_indices = Counter(outlier_indices)\n",
        "    multiple_outliers = list(i for i, v in outlier_indices.items() if v > 2)\n",
        "    \n",
        "    return multiple_outliers"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:38.799887Z",
          "iopub.status.busy": "2021-03-17T14:55:38.799252Z",
          "iopub.status.idle": "2021-03-17T14:55:38.939686Z",
          "shell.execute_reply": "2021-03-17T14:55:38.940146Z"
        },
        "papermill": {
          "duration": 0.24467,
          "end_time": "2021-03-17T14:55:38.940322",
          "exception": false,
          "start_time": "2021-03-17T14:55:38.695652",
          "status": "completed"
        },
        "tags": [],
        "id": "dqepi_u-SBGu",
        "outputId": "8e39b7c5-4e98-468a-e350-26bde175ab03"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>gender</th>\n",
              "      <th>race/ethnicity</th>\n",
              "      <th>parental level of education</th>\n",
              "      <th>lunch</th>\n",
              "      <th>test preparation course</th>\n",
              "      <th>math score</th>\n",
              "      <th>reading score</th>\n",
              "      <th>writing score</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>59</th>\n",
              "      <td>female</td>\n",
              "      <td>group C</td>\n",
              "      <td>some high school</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>0</td>\n",
              "      <td>17</td>\n",
              "      <td>10</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>980</th>\n",
              "      <td>female</td>\n",
              "      <td>group B</td>\n",
              "      <td>high school</td>\n",
              "      <td>free/reduced</td>\n",
              "      <td>none</td>\n",
              "      <td>8</td>\n",
              "      <td>24</td>\n",
              "      <td>23</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     gender race/ethnicity parental level of education         lunch  \\\n",
              "59   female        group C            some high school  free/reduced   \n",
              "980  female        group B                 high school  free/reduced   \n",
              "\n",
              "    test preparation course  math score  reading score  writing score  \n",
              "59                     none           0             17             10  \n",
              "980                    none           8             24             23  "
            ]
          },
          "execution_count": 30,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset.loc[detect_outliers(dataset,['math score', 'reading score', 'writing score'])]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:39.147421Z",
          "iopub.status.busy": "2021-03-17T14:55:39.146818Z",
          "iopub.status.idle": "2021-03-17T14:55:39.149781Z",
          "shell.execute_reply": "2021-03-17T14:55:39.150327Z"
        },
        "papermill": {
          "duration": 0.108931,
          "end_time": "2021-03-17T14:55:39.150506",
          "exception": false,
          "start_time": "2021-03-17T14:55:39.041575",
          "status": "completed"
        },
        "tags": [],
        "id": "2jSCKb1TSBGu"
      },
      "outputs": [],
      "source": [
        "# drop outliers\n",
        "#train_df = train_df.drop(detect_outliers(train_df,[\"Age\",\"SibSp\",\"Parch\",\"Fare\"]),axis = 0).reset_index(drop = True)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.114925,
          "end_time": "2021-03-17T14:55:39.363360",
          "exception": false,
          "start_time": "2021-03-17T14:55:39.248435",
          "status": "completed"
        },
        "tags": [],
        "id": "2HElVQV9SBGu"
      },
      "source": [
        "If we were to work on a Machine Learning model, we would have to drop outliers. However, this notebook was written for visualization and EDA. Therefore, I will continue with outliers."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.150634,
          "end_time": "2021-03-17T14:55:39.633314",
          "exception": false,
          "start_time": "2021-03-17T14:55:39.482680",
          "status": "completed"
        },
        "tags": [],
        "id": "EEMCwCDVSBGu"
      },
      "source": [
        "<a id = \"13\"></a><br>\n",
        "# Visualization"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.101548,
          "end_time": "2021-03-17T14:55:39.835832",
          "exception": false,
          "start_time": "2021-03-17T14:55:39.734284",
          "status": "completed"
        },
        "tags": [],
        "id": "hAFnwjiaSBGu"
      },
      "source": [
        "<a id = \"14\"></a><br>\n",
        "## Pie Plot\n",
        "\n",
        "Pie Charts help show proportions and percentages across categories by dividing a circle into proportional parts. Each arc length represents a proportion of each category, while the full circle represents the sum of all data equal to 100%. Pie charts are ideal for giving the reader a quick idea of the proportional distribution of the data."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:40.042354Z",
          "iopub.status.busy": "2021-03-17T14:55:40.041757Z",
          "iopub.status.idle": "2021-03-17T14:55:40.172014Z",
          "shell.execute_reply": "2021-03-17T14:55:40.172527Z"
        },
        "papermill": {
          "duration": 0.235249,
          "end_time": "2021-03-17T14:55:40.172767",
          "exception": false,
          "start_time": "2021-03-17T14:55:39.937518",
          "status": "completed"
        },
        "tags": [],
        "id": "OC5E3Li-SBGu",
        "outputId": "5356f6de-7286-418e-d095-e8709968e2ee"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "Text(0.5, 1.0, 'Distribution of Students by Races')"
            ]
          },
          "execution_count": 32,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 40600 characters]\n",
            "text/plain": [
              "<Figure size 576x576 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "labels = dataset['race/ethnicity'].value_counts().index\n",
        "sizes = dataset['race/ethnicity'].value_counts().values\n",
        "\n",
        "plt.figure(figsize = (8,8))\n",
        "plt.pie(sizes, labels=labels, autopct='%1.1f%%')\n",
        "plt.title('Distribution of Students by Races',color = 'black',fontsize = 15)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.103882,
          "end_time": "2021-03-17T14:55:40.378146",
          "exception": false,
          "start_time": "2021-03-17T14:55:40.274264",
          "status": "completed"
        },
        "tags": [],
        "id": "qvQHgu-pSBGu"
      },
      "source": [
        "This graphic shows the distribution of samples according to their race/ethnicity."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:40.590507Z",
          "iopub.status.busy": "2021-03-17T14:55:40.589826Z",
          "iopub.status.idle": "2021-03-17T14:55:40.676680Z",
          "shell.execute_reply": "2021-03-17T14:55:40.677172Z"
        },
        "papermill": {
          "duration": 0.196697,
          "end_time": "2021-03-17T14:55:40.677338",
          "exception": false,
          "start_time": "2021-03-17T14:55:40.480641",
          "status": "completed"
        },
        "tags": [],
        "id": "YUqk1eDGSBGu",
        "outputId": "7abcd9a0-c8e7-4334-bd18-2e22debf3d0e"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "Text(0.5, 1.0, 'Distribution of Students by Genders')"
            ]
          },
          "execution_count": 33,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 25948 characters]\n",
            "text/plain": [
              "<Figure size 576x576 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "labels = dataset['gender'].value_counts().index\n",
        "sizes = dataset['gender'].value_counts().values\n",
        "\n",
        "plt.figure(figsize = (8,8))\n",
        "plt.pie(sizes, labels=labels, autopct='%1.1f%%')\n",
        "plt.title('Distribution of Students by Genders',color = 'black',fontsize = 15)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.103666,
          "end_time": "2021-03-17T14:55:40.886229",
          "exception": false,
          "start_time": "2021-03-17T14:55:40.782563",
          "status": "completed"
        },
        "tags": [],
        "id": "rOcz7QLcSBGv"
      },
      "source": [
        "This graphic shows the distribution of samples according to their gender."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.106093,
          "end_time": "2021-03-17T14:55:41.095984",
          "exception": false,
          "start_time": "2021-03-17T14:55:40.989891",
          "status": "completed"
        },
        "tags": [],
        "id": "2VYsUz7YSBGv"
      },
      "source": [
        "<a id = \"15\"></a><br>\n",
        "## Violin Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.101677,
          "end_time": "2021-03-17T14:55:41.301275",
          "exception": false,
          "start_time": "2021-03-17T14:55:41.199598",
          "status": "completed"
        },
        "tags": [],
        "id": "G-UxetigSBGv"
      },
      "source": [
        "A Violin Plot is used to visualize the distribution and probability density of the data. The thick black bar in the middle represents the interquartile range; The vertically extended thin black line represents 95% confidence intervals and the white point is the media."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:41.537674Z",
          "iopub.status.busy": "2021-03-17T14:55:41.536691Z",
          "iopub.status.idle": "2021-03-17T14:55:41.975997Z",
          "shell.execute_reply": "2021-03-17T14:55:41.975451Z"
        },
        "papermill": {
          "duration": 0.571818,
          "end_time": "2021-03-17T14:55:41.976143",
          "exception": false,
          "start_time": "2021-03-17T14:55:41.404325",
          "status": "completed"
        },
        "tags": [],
        "id": "E-y6Prc4SBGv",
        "outputId": "2d3fca1d-ebad-428c-aaac-ba1f9651f2cd"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='gender', ylabel='writing score'>"
            ]
          },
          "execution_count": 34,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 84644 characters]\n",
            "text/plain": [
              "<Figure size 1440x1080 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "plt.figure(figsize=(20,15))\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "plt.subplot(2,3,1)\n",
        "sns.violinplot(x = 'gender', y = 'math score', data = dataset)\n",
        "plt.subplot(2,3,2)\n",
        "sns.violinplot(x = 'gender', y = 'reading score', data = dataset)\n",
        "plt.subplot(2,3,3)\n",
        "sns.violinplot(x = 'gender', y = 'writing score', data = dataset)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.103502,
          "end_time": "2021-03-17T14:55:42.234737",
          "exception": false,
          "start_time": "2021-03-17T14:55:42.131235",
          "status": "completed"
        },
        "tags": [],
        "id": "RS8HpmotSBGv"
      },
      "source": [
        "With these graphs, we see the distribution of the scores of men and women.\n",
        "\n",
        "* For the Math Score: Bloating is in almost the same location, but female show a line to under 20. It ends around 20 in male.\n",
        "* For Reading Score: There is an accumulation of 70-80 in females. In males, the notes are more evenly spread.\n",
        "* For Writing Score: It can be seen that the average of females is significantly higher than that of males."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.104958,
          "end_time": "2021-03-17T14:55:42.446083",
          "exception": false,
          "start_time": "2021-03-17T14:55:42.341125",
          "status": "completed"
        },
        "tags": [],
        "id": "BRyLGmgXSBGv"
      },
      "source": [
        "<a id = \"16\"></a><br>\n",
        "## Boxen Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.104794,
          "end_time": "2021-03-17T14:55:42.656377",
          "exception": false,
          "start_time": "2021-03-17T14:55:42.551583",
          "status": "completed"
        },
        "tags": [],
        "id": "WW7eScDnSBGv"
      },
      "source": [
        "The Boxen plot is very similar to box plot, except for the fact that it plots different quartile values. By plotting different quartile values, we are able to understand the shape of the distribution particularly in the head end and tail end.\n",
        "\n",
        "Source for this explanation: https://madhuramiah.medium.com/some-interesting-visualizations-with-seaborn-python-ad207f50b844#:~:text=The%20Boxen%20plot%20is%20very,head%20end%20and%20tail%20end."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:42.903157Z",
          "iopub.status.busy": "2021-03-17T14:55:42.902086Z",
          "iopub.status.idle": "2021-03-17T14:55:43.279706Z",
          "shell.execute_reply": "2021-03-17T14:55:43.280182Z"
        },
        "papermill": {
          "duration": 0.516335,
          "end_time": "2021-03-17T14:55:43.280358",
          "exception": false,
          "start_time": "2021-03-17T14:55:42.764023",
          "status": "completed"
        },
        "tags": [],
        "id": "LAn9GXtMSBGv",
        "outputId": "95c314b9-0d0b-413d-a9c4-05cc1a163ee3"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='lunch', ylabel='writing score'>"
            ]
          },
          "execution_count": 35,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 32072 characters]\n",
            "text/plain": [
              "<Figure size 1440x1080 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "import seaborn as sns\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "\n",
        "\n",
        "plt.figure(figsize=(20,15))\n",
        "\n",
        "plt.subplot(2,3,1)\n",
        "sns.boxenplot(x=dataset['lunch'], y=dataset['math score'],\n",
        "              color=\"b\", \n",
        "              scale=\"linear\", data=dataset)\n",
        "\n",
        "plt.subplot(2,3,2)\n",
        "sns.boxenplot(x=dataset['lunch'], y=dataset['reading score'],\n",
        "              color=\"b\", \n",
        "              scale=\"linear\", data=dataset)\n",
        "\n",
        "plt.subplot(2,3,3)\n",
        "sns.boxenplot(x=dataset['lunch'], y=dataset['writing score'],\n",
        "              color=\"b\", \n",
        "              scale=\"linear\", data=dataset)\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.108306,
          "end_time": "2021-03-17T14:55:43.497946",
          "exception": false,
          "start_time": "2021-03-17T14:55:43.389640",
          "status": "completed"
        },
        "tags": [],
        "id": "JLxnFui6SBGv"
      },
      "source": [
        "These plots show the change of the Score according to the 'lunch' feature. In general, the 'standard' ones appear to have higher scores."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.107127,
          "end_time": "2021-03-17T14:55:43.713458",
          "exception": false,
          "start_time": "2021-03-17T14:55:43.606331",
          "status": "completed"
        },
        "tags": [],
        "id": "AMy9rrsbSBGv"
      },
      "source": [
        "<a id = \"17\"></a><br>\n",
        "## Swarm Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.108763,
          "end_time": "2021-03-17T14:55:43.931350",
          "exception": false,
          "start_time": "2021-03-17T14:55:43.822587",
          "status": "completed"
        },
        "tags": [],
        "id": "bgpZIf1sSBGv"
      },
      "source": [
        "Seaborn swarmplot is probably similar to stripplot, only the points are adjusted so it won’t get overlap to each other as it helps to represent the better representation of the distribution of values. A swarm plot can be drawn on its own, but it is also a good complement to a box, preferable because the associated names will be used to annotate the axes. This type of plot sometimes known as “beeswarm”.\n",
        "\n",
        "Soruce for this text: https://www.geeksforgeeks.org/swarmplot-using-seaborn-in-python/"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:44.174644Z",
          "iopub.status.busy": "2021-03-17T14:55:44.166712Z",
          "iopub.status.idle": "2021-03-17T14:55:47.319929Z",
          "shell.execute_reply": "2021-03-17T14:55:47.320633Z"
        },
        "papermill": {
          "duration": 3.282016,
          "end_time": "2021-03-17T14:55:47.320833",
          "exception": false,
          "start_time": "2021-03-17T14:55:44.038817",
          "status": "completed"
        },
        "tags": [],
        "id": "vPi56DnISBGv",
        "outputId": "0ee6a15d-23dc-4ed2-f0da-c010c2d0aaf1"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 303540 characters]\n",
            "text/plain": [
              "<Figure size 1440x1080 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "import seaborn as sns\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "\n",
        "plt.figure(figsize=(20,15))\n",
        "\n",
        "plt.subplot(2,3,1)\n",
        "sns.swarmplot(x=\"test preparation course\", y=\"math score\",hue=\"parental level of education\", data=dataset, palette=\"PRGn\")\n",
        "\n",
        "plt.subplot(2,3,2)\n",
        "sns.swarmplot(x=\"test preparation course\", y=\"reading score\",hue=\"parental level of education\", data=dataset, palette=\"PRGn\")\n",
        "\n",
        "plt.subplot(2,3,3)\n",
        "sns.swarmplot(x=\"test preparation course\", y=\"writing score\",hue=\"parental level of education\", data=dataset, palette=\"PRGn\")\n",
        "\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.115965,
          "end_time": "2021-03-17T14:55:47.554919",
          "exception": false,
          "start_time": "2021-03-17T14:55:47.438954",
          "status": "completed"
        },
        "tags": [],
        "id": "4_hEHMdJSBGv"
      },
      "source": [
        "In these graphs, the distribution of Scores according to the 'test preparation course' feature can be seen. At the same time, the education level of the students' families is also seen. We got an image similar to the one we got on Violin Plot. However, with the 'hue' parameter used in swarmplot, we made the plot 3-dimensional."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.116614,
          "end_time": "2021-03-17T14:55:47.787262",
          "exception": false,
          "start_time": "2021-03-17T14:55:47.670648",
          "status": "completed"
        },
        "tags": [],
        "id": "JbtwhkqZSBGw"
      },
      "source": [
        "<a id = \"18\"></a><br>\n",
        "## Bar Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.117793,
          "end_time": "2021-03-17T14:55:48.020953",
          "exception": false,
          "start_time": "2021-03-17T14:55:47.903160",
          "status": "completed"
        },
        "tags": [],
        "id": "Ok2xCbSgSBGw"
      },
      "source": [
        "The Classic Bar Plot is useful for distinguishing between categories and showing numerical comparisons using horizontal or vertical columns. One axis of the chart shows the categories being compared, and the other axis shows a scale of values.\n",
        "\n",
        "Bar plots differ from Histograms in that they do not show continuous and continuous improvements over a period of time. The discrete data of the Bar Plot are categorical data and therefore \"How many?\" gives an answer to the question.\n",
        "\n",
        "Major mistake made in Bar Plot makes definitions problematic as there are too many columns."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:48.292379Z",
          "iopub.status.busy": "2021-03-17T14:55:48.282079Z",
          "iopub.status.idle": "2021-03-17T14:55:48.464966Z",
          "shell.execute_reply": "2021-03-17T14:55:48.464368Z"
        },
        "papermill": {
          "duration": 0.324095,
          "end_time": "2021-03-17T14:55:48.465108",
          "exception": false,
          "start_time": "2021-03-17T14:55:48.141013",
          "status": "completed"
        },
        "tags": [],
        "id": "dKDyrlnzSBGw",
        "outputId": "af26afc1-3f27-4b9a-dd7b-57003534c21a"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 46512 characters]\n",
            "text/plain": [
              "<Figure size 720x504 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "counts = dataset['parental level of education'].value_counts()\n",
        "\n",
        "plt.figure(figsize=(10,7))\n",
        "sns.barplot(x=counts.index, y=counts.values, palette=\"Set3\")\n",
        "\n",
        "plt.ylabel('Number of Degree')\n",
        "plt.xlabel('Degrees', style = 'normal', size = 24)\n",
        "\n",
        "plt.xticks(rotation = 45, size = 12)\n",
        "plt.yticks(rotation = 45, size = 12)\n",
        "\n",
        "plt.title('Distribution of Parental Level of Education',color = 'black',fontsize=15)\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.116829,
          "end_time": "2021-03-17T14:55:48.702279",
          "exception": false,
          "start_time": "2021-03-17T14:55:48.585450",
          "status": "completed"
        },
        "tags": [],
        "id": "RD2HfuhXSBGw"
      },
      "source": [
        "This chart shows the distribution of the Parental Level of Education."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.118478,
          "end_time": "2021-03-17T14:55:48.938751",
          "exception": false,
          "start_time": "2021-03-17T14:55:48.820273",
          "status": "completed"
        },
        "tags": [],
        "id": "nNCGqbpSSBGw"
      },
      "source": [
        "<a id = \"19\"></a><br>\n",
        "## Joint Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.117353,
          "end_time": "2021-03-17T14:55:49.174854",
          "exception": false,
          "start_time": "2021-03-17T14:55:49.057501",
          "status": "completed"
        },
        "tags": [],
        "id": "rshzjsEKSBGw"
      },
      "source": [
        "Draw a plot of two variables with bivariate and univariate graphs.\n",
        "\n",
        "This function provides a convenient interface to the JointGrid class, with several canned plot kinds. This is intended to be a fairly lightweight wrapper; if you need more flexibility, you should use JointGrid directly.\n",
        "\n",
        "Source: http://seaborn.pydata.org/generated/seaborn.jointplot.html"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:49.414068Z",
          "iopub.status.busy": "2021-03-17T14:55:49.413456Z",
          "iopub.status.idle": "2021-03-17T14:55:49.416777Z",
          "shell.execute_reply": "2021-03-17T14:55:49.417169Z"
        },
        "papermill": {
          "duration": 0.126776,
          "end_time": "2021-03-17T14:55:49.417339",
          "exception": false,
          "start_time": "2021-03-17T14:55:49.290563",
          "status": "completed"
        },
        "tags": [],
        "id": "O7vwHNxTSBGw"
      },
      "outputs": [],
      "source": [
        "dataset['overall'] = (dataset['math score'] + dataset['reading score'] + dataset['writing score'])/3"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.116444,
          "end_time": "2021-03-17T14:55:49.648594",
          "exception": false,
          "start_time": "2021-03-17T14:55:49.532150",
          "status": "completed"
        },
        "tags": [],
        "id": "roNEoLhuSBGw"
      },
      "source": [
        "**Why did I create an 'overall' column?**\n",
        "\n",
        "I got the average of reading, writing and math scores to see the students' success in all tests in a single variable. In the following graphs, I will compare 'overall' to other scores."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:49.904276Z",
          "iopub.status.busy": "2021-03-17T14:55:49.896151Z",
          "iopub.status.idle": "2021-03-17T14:55:50.422958Z",
          "shell.execute_reply": "2021-03-17T14:55:50.422063Z"
        },
        "papermill": {
          "duration": 0.657398,
          "end_time": "2021-03-17T14:55:50.423176",
          "exception": false,
          "start_time": "2021-03-17T14:55:49.765778",
          "status": "completed"
        },
        "tags": [],
        "id": "dyr-mpfwSBGw",
        "outputId": "0da577bc-c89a-47df-8280-80e5225c80c4"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 48584 characters]\n",
            "text/plain": [
              "<Figure size 504x504 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"darkgrid\")\n",
        "g = sns.jointplot(x = dataset['math score'], y = dataset['overall'], kind = 'hex', size=7)\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.116904,
          "end_time": "2021-03-17T14:55:50.663397",
          "exception": false,
          "start_time": "2021-03-17T14:55:50.546493",
          "status": "completed"
        },
        "tags": [],
        "id": "JGVaRFqTSBGw"
      },
      "source": [
        "As expected, there is a linear relationship between the overall - math score. It is observed that the largest concentration is between 60-80."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:51.027908Z",
          "iopub.status.busy": "2021-03-17T14:55:51.026930Z",
          "iopub.status.idle": "2021-03-17T14:55:52.379503Z",
          "shell.execute_reply": "2021-03-17T14:55:52.380005Z"
        },
        "papermill": {
          "duration": 1.597404,
          "end_time": "2021-03-17T14:55:52.380172",
          "exception": false,
          "start_time": "2021-03-17T14:55:50.782768",
          "status": "completed"
        },
        "tags": [],
        "id": "B2ZQybkrSBGw",
        "outputId": "c929cac8-64e0-4f09-b7a6-79f4a4d3fabb"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 61724 characters]\n",
            "text/plain": [
              "<Figure size 504x504 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"darkgrid\")\n",
        "g = sns.jointplot(x = dataset['reading score'], y = dataset['overall'], kind=\"kde\", size=7)\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.118707,
          "end_time": "2021-03-17T14:55:52.620749",
          "exception": false,
          "start_time": "2021-03-17T14:55:52.502042",
          "status": "completed"
        },
        "tags": [],
        "id": "f2I4KOvQSBGw"
      },
      "source": [
        "Another kind of Joint Plot. The points where the lines are concentrated show that there are more students in that grade range. Between 60-80."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:52.883440Z",
          "iopub.status.busy": "2021-03-17T14:55:52.882801Z",
          "iopub.status.idle": "2021-03-17T14:55:53.551033Z",
          "shell.execute_reply": "2021-03-17T14:55:53.550508Z"
        },
        "papermill": {
          "duration": 0.810272,
          "end_time": "2021-03-17T14:55:53.551178",
          "exception": false,
          "start_time": "2021-03-17T14:55:52.740906",
          "status": "completed"
        },
        "tags": [],
        "id": "V13RIB3mSBGw",
        "outputId": "ddf6a979-d2c2-46d0-dd3c-872ae5125e2d"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 53836 characters]\n",
            "text/plain": [
              "<Figure size 504x504 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"darkgrid\")\n",
        "g = sns.jointplot(x = dataset['writing score'], y = dataset['overall'], kind=\"reg\", size=7)\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.122172,
          "end_time": "2021-03-17T14:55:53.797867",
          "exception": false,
          "start_time": "2021-03-17T14:55:53.675695",
          "status": "completed"
        },
        "tags": [],
        "id": "1wi1RvI9SBGw"
      },
      "source": [
        "In this graph, as in the others, a linear increase is observed between 'overall' and any Score value. The distribution of students seems balanced between 50-85."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.123815,
          "end_time": "2021-03-17T14:55:54.043047",
          "exception": false,
          "start_time": "2021-03-17T14:55:53.919232",
          "status": "completed"
        },
        "tags": [],
        "id": "dqkvnN5dSBGw"
      },
      "source": [
        "<a id = \"20\"></a><br>\n",
        "## Heatmap"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.122107,
          "end_time": "2021-03-17T14:55:54.289215",
          "exception": false,
          "start_time": "2021-03-17T14:55:54.167108",
          "status": "completed"
        },
        "tags": [],
        "id": "R-LE_eh8SBGx"
      },
      "source": [
        "Heat maps visualize data with color changes. When applied to the table format, its variables are placed in rows and columns. Coloring the boxes in the table is useful for examining multivariate crosstab data. Heat maps are good for showing more than one variable, revealing any patterns or showing if any variables are alike, and detecting whether there is any correlation between them."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:54.540268Z",
          "iopub.status.busy": "2021-03-17T14:55:54.539611Z",
          "iopub.status.idle": "2021-03-17T14:55:54.549656Z",
          "shell.execute_reply": "2021-03-17T14:55:54.549153Z"
        },
        "papermill": {
          "duration": 0.137724,
          "end_time": "2021-03-17T14:55:54.549803",
          "exception": false,
          "start_time": "2021-03-17T14:55:54.412079",
          "status": "completed"
        },
        "tags": [],
        "id": "R24AybgnSBGx",
        "outputId": "fb139834-9856-48c9-f02d-acdd291a5f7d"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>math score</th>\n",
              "      <th>reading score</th>\n",
              "      <th>writing score</th>\n",
              "      <th>overall</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>math score</th>\n",
              "      <td>1.000000</td>\n",
              "      <td>0.817580</td>\n",
              "      <td>0.802642</td>\n",
              "      <td>0.918746</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>reading score</th>\n",
              "      <td>0.817580</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>0.954598</td>\n",
              "      <td>0.970331</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>writing score</th>\n",
              "      <td>0.802642</td>\n",
              "      <td>0.954598</td>\n",
              "      <td>1.000000</td>\n",
              "      <td>0.965667</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>overall</th>\n",
              "      <td>0.918746</td>\n",
              "      <td>0.970331</td>\n",
              "      <td>0.965667</td>\n",
              "      <td>1.000000</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "               math score  reading score  writing score   overall\n",
              "math score       1.000000       0.817580       0.802642  0.918746\n",
              "reading score    0.817580       1.000000       0.954598  0.970331\n",
              "writing score    0.802642       0.954598       1.000000  0.965667\n",
              "overall          0.918746       0.970331       0.965667  1.000000"
            ]
          },
          "execution_count": 42,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "dataset.corr()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:54.811830Z",
          "iopub.status.busy": "2021-03-17T14:55:54.811136Z",
          "iopub.status.idle": "2021-03-17T14:55:55.073814Z",
          "shell.execute_reply": "2021-03-17T14:55:55.074342Z"
        },
        "papermill": {
          "duration": 0.399877,
          "end_time": "2021-03-17T14:55:55.074546",
          "exception": false,
          "start_time": "2021-03-17T14:55:54.674669",
          "status": "completed"
        },
        "tags": [],
        "id": "QN5OqYR-SBGx",
        "outputId": "5b3264be-2cda-40eb-af06-6416d49b49ab"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 28944 characters]\n",
            "text/plain": [
              "<Figure size 720x432 with 2 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "plt.figure(figsize=(10,6)) \n",
        "sns.heatmap(dataset.corr(), annot=True, cmap='Dark2_r', linewidths = .2)\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.126408,
          "end_time": "2021-03-17T14:55:55.331739",
          "exception": false,
          "start_time": "2021-03-17T14:55:55.205331",
          "status": "completed"
        },
        "tags": [],
        "id": "RgdSFUgISBGx"
      },
      "source": [
        "Correlated features are seen in this Heat Map. We have already created the variable 'overall'. Increasing any value will increase 'overall' anyway. It can be deduced from the chart that there is a positive correlation between reading and writing."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.123539,
          "end_time": "2021-03-17T14:55:55.580057",
          "exception": false,
          "start_time": "2021-03-17T14:55:55.456518",
          "status": "completed"
        },
        "tags": [],
        "id": "rt_k7vjeSBGx"
      },
      "source": [
        "<a id = \"21\"></a><br>\n",
        "## Pair Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.127759,
          "end_time": "2021-03-17T14:55:55.854740",
          "exception": false,
          "start_time": "2021-03-17T14:55:55.726981",
          "status": "completed"
        },
        "tags": [],
        "id": "7_kBS2AzSBGx"
      },
      "source": [
        "Plot pairwise relationships in a dataset.\n",
        "\n",
        "By default, this function will create a grid of Axes such that each numeric variable in data will by shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots are treated differently: a univariate distribution plot is drawn to show the marginal distribution of the data in each column.\n",
        "\n",
        "It is also possible to show a subset of variables or plot different variables on the rows and columns.\n",
        "\n",
        "Source: https://seaborn.pydata.org/generated/seaborn.pairplot.html"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:55:56.112821Z",
          "iopub.status.busy": "2021-03-17T14:55:56.112065Z",
          "iopub.status.idle": "2021-03-17T14:56:00.565998Z",
          "shell.execute_reply": "2021-03-17T14:56:00.566497Z"
        },
        "papermill": {
          "duration": 4.58457,
          "end_time": "2021-03-17T14:56:00.566705",
          "exception": false,
          "start_time": "2021-03-17T14:55:55.982135",
          "status": "completed"
        },
        "tags": [],
        "id": "m3NzfMDOSBGx",
        "outputId": "bc700517-698c-4b59-cba3-dabc6437fa0b"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.PairGrid at 0x7f55155a2210>"
            ]
          },
          "execution_count": 44,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 266456 characters]\n",
            "text/plain": [
              "<Figure size 830.6x720 with 20 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"darkgrid\")\n",
        "sns.pairplot(dataset, hue=\"lunch\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.134764,
          "end_time": "2021-03-17T14:56:00.839680",
          "exception": false,
          "start_time": "2021-03-17T14:56:00.704916",
          "status": "completed"
        },
        "tags": [],
        "id": "C6jcnQfoSBGx"
      },
      "source": [
        "***What conclusion can be drawn from this graph?***\n",
        "\n",
        "As we have reached in previous plots and reviews, students with 'lunch' = 'standard' generally do better than others."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:01.132468Z",
          "iopub.status.busy": "2021-03-17T14:56:01.131820Z",
          "iopub.status.idle": "2021-03-17T14:56:06.341493Z",
          "shell.execute_reply": "2021-03-17T14:56:06.340907Z"
        },
        "papermill": {
          "duration": 5.36849,
          "end_time": "2021-03-17T14:56:06.341640",
          "exception": false,
          "start_time": "2021-03-17T14:56:00.973150",
          "status": "completed"
        },
        "tags": [],
        "id": "6qfOxX6WSBGx",
        "outputId": "dcfbef3e-9934-4797-a884-a9ac9279e7fa"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.PairGrid at 0x7f55155047d0>"
            ]
          },
          "execution_count": 45,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 286588 characters]\n",
            "text/plain": [
              "<Figure size 811.675x720 with 20 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.pairplot(dataset, hue=\"race/ethnicity\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.138472,
          "end_time": "2021-03-17T14:56:06.624663",
          "exception": false,
          "start_time": "2021-03-17T14:56:06.486191",
          "status": "completed"
        },
        "tags": [],
        "id": "1NgNRHH2SBGx"
      },
      "source": [
        "These graphs are difficult to interpret as there are five options for 'race / ethnicity'. There is no clear distinction between points. I think using two and a maximum of three categories for the Pair Plot will make it easier to interpret."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.141388,
          "end_time": "2021-03-17T14:56:06.907332",
          "exception": false,
          "start_time": "2021-03-17T14:56:06.765944",
          "status": "completed"
        },
        "tags": [],
        "id": "seMN0l-5SBGx"
      },
      "source": [
        "***How effective is the test preparation course?***"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:07.200166Z",
          "iopub.status.busy": "2021-03-17T14:56:07.199141Z",
          "iopub.status.idle": "2021-03-17T14:56:11.873822Z",
          "shell.execute_reply": "2021-03-17T14:56:11.874412Z"
        },
        "papermill": {
          "duration": 4.826079,
          "end_time": "2021-03-17T14:56:11.874589",
          "exception": false,
          "start_time": "2021-03-17T14:56:07.048510",
          "status": "completed"
        },
        "tags": [],
        "id": "beBNvI8mSBGx",
        "outputId": "9eed3077-19c0-4249-ea78-f531e8d97aa1"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.PairGrid at 0x7f550ab42490>"
            ]
          },
          "execution_count": 46,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 271112 characters]\n",
            "text/plain": [
              "<Figure size 870.3x720 with 20 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.pairplot(dataset, hue=\"test preparation course\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.153563,
          "end_time": "2021-03-17T14:56:12.181833",
          "exception": false,
          "start_time": "2021-03-17T14:56:12.028270",
          "status": "completed"
        },
        "tags": [],
        "id": "D1pUELnnSBGx"
      },
      "source": [
        "**As an answer to the above question;**\n",
        "\n",
        "We see that the orange dots with 'test preparation course' = 'completed' are higher on the graphs."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.176181,
          "end_time": "2021-03-17T14:56:12.511864",
          "exception": false,
          "start_time": "2021-03-17T14:56:12.335683",
          "status": "completed"
        },
        "tags": [],
        "id": "za2Ma0CaSBGx"
      },
      "source": [
        "<a id = \"22\"></a><br>\n",
        "## Box Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.148368,
          "end_time": "2021-03-17T14:56:12.807979",
          "exception": false,
          "start_time": "2021-03-17T14:56:12.659611",
          "status": "completed"
        },
        "tags": [],
        "id": "nhZ4awgISBGx"
      },
      "source": [
        "Box charts are an easy way to visually show the distribution of a quarter of the data.\n",
        "\n",
        "Lines running parallel to the box are known as \"Whiskers\" and are used to indicate variation between data above or below a quarter. Extreme values are drawn with individual points in line with the lines sometimes called whiskers. Box-Whisker charts can be drawn horizontally or vertically.\n",
        "\n",
        "Although box plots look very primitive compared to Histograms and density lines, they have the advantage of taking up less space, which is useful when comparing many group or dataset distributions."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.150068,
          "end_time": "2021-03-17T14:56:13.108173",
          "exception": false,
          "start_time": "2021-03-17T14:56:12.958105",
          "status": "completed"
        },
        "tags": [],
        "id": "0AH2AQmvSBGx"
      },
      "source": [
        "***Which major factors contribute to test outcomes?***"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:13.432568Z",
          "iopub.status.busy": "2021-03-17T14:56:13.428043Z",
          "iopub.status.idle": "2021-03-17T14:56:14.899359Z",
          "shell.execute_reply": "2021-03-17T14:56:14.898831Z"
        },
        "papermill": {
          "duration": 1.644512,
          "end_time": "2021-03-17T14:56:14.899527",
          "exception": false,
          "start_time": "2021-03-17T14:56:13.255015",
          "status": "completed"
        },
        "tags": [],
        "id": "PUtjJ8pMSBGx",
        "outputId": "188245bb-f792-4fcb-dced-3717f0918bae"
      },
      "outputs": [
        {
          "data": {
            "image/png": "[encoded data, 74604 characters]\n",
            "text/plain": [
              "<Figure size 1440x1080 with 4 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"darkgrid\", palette=\"pastel\")\n",
        "\n",
        "plt.figure(figsize=(20,15))\n",
        "\n",
        "plt.subplot(2,2,1)\n",
        "sns.boxplot(x=\"gender\", y=\"overall\", hue=\"test preparation course\", data=dataset)\n",
        "\n",
        "plt.subplot(2,2,2)\n",
        "sns.boxplot(x=\"gender\", y=\"overall\", hue=\"parental level of education\", data=dataset)\n",
        "\n",
        "plt.subplot(2,2,3)\n",
        "sns.boxplot(x=\"gender\", y=\"overall\", hue=\"lunch\", data=dataset)\n",
        "\n",
        "plt.subplot(2,2,4)\n",
        "sns.boxplot(x=\"gender\", y=\"overall\", hue=\"race/ethnicity\", data=dataset)\n",
        "\n",
        "sns.despine(offset=10, trim=True)\n",
        "plt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.153978,
          "end_time": "2021-03-17T14:56:15.209160",
          "exception": false,
          "start_time": "2021-03-17T14:56:15.055182",
          "status": "completed"
        },
        "tags": [],
        "id": "wh_TLYdnSBGy"
      },
      "source": [
        "**As an answer to the above question;**\n",
        "\n",
        "*** For females:** 'test preparation course' = 'completed' and 'parental level of education' = 'master's degree' and 'lunch' = 'standard' and 'race / ethnicity' = 'group E' values can be shown as factors that increase success.\n",
        "\n",
        "*** For males:** 'test preparation course' = 'completed' and 'parental level of education' = 'master's degree' and 'lunch' = 'standard' and 'race / ethnicity' = 'group E' values can be shown as factors that increase success.\n",
        "\n",
        "Since all values are equal for males and females, they can be cited as factors that increase the success of any student."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.150195,
          "end_time": "2021-03-17T14:56:15.509399",
          "exception": false,
          "start_time": "2021-03-17T14:56:15.359204",
          "status": "completed"
        },
        "tags": [],
        "id": "UNTFxZNbSBGy"
      },
      "source": [
        "<a id = \"23\"></a><br>\n",
        "## Scatter Plot"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.150869,
          "end_time": "2021-03-17T14:56:15.809512",
          "exception": false,
          "start_time": "2021-03-17T14:56:15.658643",
          "status": "completed"
        },
        "tags": [],
        "id": "cen0IEEySBGy"
      },
      "source": [
        "The Scatter Chart uses a collection of points placed using Cartesian coordinates to display the values of two variables. By displaying one variable on each axis, it can be determined whether there is a relationship or correlation between two variables.\n",
        "\n",
        "Various types of correlation can be interpreted through the models displayed on the scatter plot. These can be listed as: positive (values increase together), negative (one value decreases as another increases), null (uncorrelated), linear, exponential, and U. The strength of correlation can be determined by how tight the points fit together on the chart. Points that go beyond the general set of points are called outliers."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.1518,
          "end_time": "2021-03-17T14:56:16.111304",
          "exception": false,
          "start_time": "2021-03-17T14:56:15.959504",
          "status": "completed"
        },
        "tags": [],
        "id": "MoLZtisGSBGy"
      },
      "source": [
        "<a id = \"24\"></a><br>\n",
        "### Scatter Plot with Marginal Ticks"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:16.443266Z",
          "iopub.status.busy": "2021-03-17T14:56:16.435345Z",
          "iopub.status.idle": "2021-03-17T14:56:17.050235Z",
          "shell.execute_reply": "2021-03-17T14:56:17.050824Z"
        },
        "papermill": {
          "duration": 0.790035,
          "end_time": "2021-03-17T14:56:17.051002",
          "exception": false,
          "start_time": "2021-03-17T14:56:16.260967",
          "status": "completed"
        },
        "tags": [],
        "id": "jnLjTbMQSBGy",
        "outputId": "d2b1a959-f792-4fa4-d873-5b42088ef704"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.JointGrid at 0x7f550a39c750>"
            ]
          },
          "execution_count": 48,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 49916 characters]\n",
            "text/plain": [
              "<Figure size 432x432 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "# Use JointGrid directly to draw a custom plot\n",
        "g = sns.JointGrid(data=dataset, x=\"overall\", y=\"math score\", space=0, ratio=17)\n",
        "g.plot_joint(sns.scatterplot, color=\"g\", alpha=.6, legend=False)\n",
        "g.plot_marginals(sns.rugplot, height=1, color=\"g\", alpha=.6)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:17.402076Z",
          "iopub.status.busy": "2021-03-17T14:56:17.401328Z",
          "iopub.status.idle": "2021-03-17T14:56:17.814920Z",
          "shell.execute_reply": "2021-03-17T14:56:17.815552Z"
        },
        "papermill": {
          "duration": 0.607518,
          "end_time": "2021-03-17T14:56:17.815753",
          "exception": false,
          "start_time": "2021-03-17T14:56:17.208235",
          "status": "completed"
        },
        "tags": [],
        "id": "S8mS8bchSBGy",
        "outputId": "2874f9cb-3e78-405b-d42f-0200a596e51a"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.JointGrid at 0x7f550aa9a950>"
            ]
          },
          "execution_count": 49,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 40808 characters]\n",
            "text/plain": [
              "<Figure size 432x432 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "g = sns.JointGrid(data=dataset, x=\"overall\", y=\"reading score\", space=0, ratio=17)\n",
        "g.plot_joint(sns.scatterplot, color=\"r\", alpha=.6, legend=False)\n",
        "g.plot_marginals(sns.rugplot, height=1, color=\"r\", alpha=.6)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:18.159850Z",
          "iopub.status.busy": "2021-03-17T14:56:18.152632Z",
          "iopub.status.idle": "2021-03-17T14:56:18.572446Z",
          "shell.execute_reply": "2021-03-17T14:56:18.572016Z"
        },
        "papermill": {
          "duration": 0.6038,
          "end_time": "2021-03-17T14:56:18.572591",
          "exception": false,
          "start_time": "2021-03-17T14:56:17.968791",
          "status": "completed"
        },
        "tags": [],
        "id": "xbeynsevSBGy",
        "outputId": "e8c65585-0364-4d4d-9554-1c9ab3b30692"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.JointGrid at 0x7f5515933d10>"
            ]
          },
          "execution_count": 50,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 40680 characters]\n",
            "text/plain": [
              "<Figure size 432x432 with 3 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "g = sns.JointGrid(data=dataset, x=\"overall\", y=\"writing score\", space=0, ratio=17)\n",
        "g.plot_joint(sns.scatterplot, color=\"b\", alpha=.6, legend=False)\n",
        "g.plot_marginals(sns.rugplot, height=1, color=\"b\", alpha=.6)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.155789,
          "end_time": "2021-03-17T14:56:18.887388",
          "exception": false,
          "start_time": "2021-03-17T14:56:18.731599",
          "status": "completed"
        },
        "tags": [],
        "id": "U111CZhwSBGy"
      },
      "source": [
        "In these plots, we got an image similar to Joint Plot. But differently, we can see the density through the lines formed parallel to the x and y axes."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.158299,
          "end_time": "2021-03-17T14:56:19.202726",
          "exception": false,
          "start_time": "2021-03-17T14:56:19.044427",
          "status": "completed"
        },
        "tags": [],
        "id": "ZeqiDSMESBGy"
      },
      "source": [
        "<a id = \"25\"></a><br>\n",
        "### Scatter Plot with Multiple Semantics"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:19.534946Z",
          "iopub.status.busy": "2021-03-17T14:56:19.527947Z",
          "iopub.status.idle": "2021-03-17T14:56:20.013164Z",
          "shell.execute_reply": "2021-03-17T14:56:20.013669Z"
        },
        "papermill": {
          "duration": 0.655214,
          "end_time": "2021-03-17T14:56:20.013834",
          "exception": false,
          "start_time": "2021-03-17T14:56:19.358620",
          "status": "completed"
        },
        "tags": [],
        "id": "CxiWCTI_SBGy",
        "outputId": "8acb0c11-8a77-42bc-ff22-388afde03f88"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='overall', ylabel='math score'>"
            ]
          },
          "execution_count": 51,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 59832 characters]\n",
            "text/plain": [
              "<Figure size 468x468 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "f, ax = plt.subplots(figsize=(6.5, 6.5))\n",
        "sns.despine(f, left=True, bottom=True)\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "sns.scatterplot(x=dataset['overall'], y=dataset['math score'],\n",
        "                hue=dataset['parental level of education'], \n",
        "                size=\"gender\",\n",
        "                palette=\"RdBu\",\n",
        "                hue_order=dataset['parental level of education'],\n",
        "                sizes=(1, 8), \n",
        "                linewidth=0,\n",
        "                data=dataset, ax=ax)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:20.366617Z",
          "iopub.status.busy": "2021-03-17T14:56:20.364544Z",
          "iopub.status.idle": "2021-03-17T14:56:20.811831Z",
          "shell.execute_reply": "2021-03-17T14:56:20.812249Z"
        },
        "papermill": {
          "duration": 0.637328,
          "end_time": "2021-03-17T14:56:20.812410",
          "exception": false,
          "start_time": "2021-03-17T14:56:20.175082",
          "status": "completed"
        },
        "tags": [],
        "id": "8m8OAppCSBGy",
        "outputId": "aa85cabd-5101-4fe8-e9d6-93f09b7556b8"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='overall', ylabel='writing score'>"
            ]
          },
          "execution_count": 52,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 56720 characters]\n",
            "text/plain": [
              "<Figure size 468x468 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "f, ax = plt.subplots(figsize=(6.5, 6.5))\n",
        "sns.despine(f, left=True, bottom=True)\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "sns.scatterplot(x=dataset['overall'], y=dataset['writing score'],\n",
        "                hue=dataset['parental level of education'], \n",
        "                size=\"gender\",\n",
        "                palette=\"Dark2\",\n",
        "                hue_order=dataset['parental level of education'],\n",
        "                sizes=(1, 8), \n",
        "                linewidth=0,\n",
        "                data=dataset, ax=ax)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:21.157971Z",
          "iopub.status.busy": "2021-03-17T14:56:21.154605Z",
          "iopub.status.idle": "2021-03-17T14:56:21.618606Z",
          "shell.execute_reply": "2021-03-17T14:56:21.618042Z"
        },
        "papermill": {
          "duration": 0.645843,
          "end_time": "2021-03-17T14:56:21.618741",
          "exception": false,
          "start_time": "2021-03-17T14:56:20.972898",
          "status": "completed"
        },
        "tags": [],
        "id": "T7b2uU9mSBGy",
        "outputId": "ee3d08ae-d89a-4b48-fd21-5df02f853207"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='overall', ylabel='reading score'>"
            ]
          },
          "execution_count": 53,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 53976 characters]\n",
            "text/plain": [
              "<Figure size 468x468 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "f, ax = plt.subplots(figsize=(6.5, 6.5))\n",
        "sns.despine(f, left=True, bottom=True)\n",
        "sns.set_theme(style=\"darkgrid\")\n",
        "sns.scatterplot(x=dataset['overall'], y=dataset['reading score'],\n",
        "                hue=dataset['parental level of education'], \n",
        "                size=\"gender\",\n",
        "                palette=\"tab20\",\n",
        "                hue_order=dataset['parental level of education'],\n",
        "                sizes=(1, 8), \n",
        "                linewidth=0,\n",
        "                data=dataset, ax=ax)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.160852,
          "end_time": "2021-03-17T14:56:21.943609",
          "exception": false,
          "start_time": "2021-03-17T14:56:21.782757",
          "status": "completed"
        },
        "tags": [],
        "id": "ondEOYMaSBGy"
      },
      "source": [
        "***What do these graphs show us?***\n",
        "\n",
        "First of all, we see a 4-dimensional graph. The color of the dots indicates the 'parental level of education', while their size indicates the gender. When the x and y axes are counted, it becomes a 4 dimensional graph."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.161115,
          "end_time": "2021-03-17T14:56:22.266201",
          "exception": false,
          "start_time": "2021-03-17T14:56:22.105086",
          "status": "completed"
        },
        "tags": [],
        "id": "ewON7E3HSBGy"
      },
      "source": [
        "<a id = \"26\"></a><br>\n",
        "## Stacked Histogram "
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.160814,
          "end_time": "2021-03-17T14:56:22.591192",
          "exception": false,
          "start_time": "2021-03-17T14:56:22.430378",
          "status": "completed"
        },
        "tags": [],
        "id": "B0AasdR5SBGy"
      },
      "source": [
        "A \"Histogram\" chart is used to show the distribution of data on an ongoing or specific time interval. Each bar / range in the histogram shows the value of the data in the pane. The sum of the values shown by all the bars is equal to the numerical value of the data used in the chart.\n",
        "\n",
        "Histograms help to predict where values are concentrated, their maximum and minimum points, breaks between data, and whether there are any unusual values. They are also useful in giving a general impression of the \"probability\" distribution."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:22.948877Z",
          "iopub.status.busy": "2021-03-17T14:56:22.947875Z",
          "iopub.status.idle": "2021-03-17T14:56:23.226287Z",
          "shell.execute_reply": "2021-03-17T14:56:23.225638Z"
        },
        "papermill": {
          "duration": 0.471858,
          "end_time": "2021-03-17T14:56:23.226429",
          "exception": false,
          "start_time": "2021-03-17T14:56:22.754571",
          "status": "completed"
        },
        "tags": [],
        "id": "ieD6NkDMSBGz",
        "outputId": "a1e68087-be62-4fbc-fdd2-222750e72818"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='overall', ylabel='Count'>"
            ]
          },
          "execution_count": 54,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 13004 characters]\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"ticks\")\n",
        "\n",
        "\n",
        "sns.histplot(\n",
        "    dataset,\n",
        "    x=\"overall\", hue=\"lunch\",\n",
        "    multiple=\"stack\",\n",
        "    palette=\"light:m_r\",\n",
        "    edgecolor=\".3\",\n",
        "    linewidth=.5,\n",
        "    #log_scale=True,\n",
        ")\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:23.594687Z",
          "iopub.status.busy": "2021-03-17T14:56:23.593608Z",
          "iopub.status.idle": "2021-03-17T14:56:23.888174Z",
          "shell.execute_reply": "2021-03-17T14:56:23.887685Z"
        },
        "papermill": {
          "duration": 0.469694,
          "end_time": "2021-03-17T14:56:23.888311",
          "exception": false,
          "start_time": "2021-03-17T14:56:23.418617",
          "status": "completed"
        },
        "tags": [],
        "id": "oS1vorCPSBGz",
        "outputId": "2fb076c8-2c99-4e16-e7fa-bf3d0d6afea9"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='overall', ylabel='Count'>"
            ]
          },
          "execution_count": 55,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 12564 characters]\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"ticks\")\n",
        "\n",
        "\n",
        "sns.histplot(\n",
        "    dataset,\n",
        "    x=\"overall\", hue=\"gender\",\n",
        "    multiple=\"stack\",\n",
        "    palette=\"light:m_r\",\n",
        "    edgecolor=\".3\",\n",
        "    linewidth=.5,\n",
        "    #log_scale=True,\n",
        ")\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:24.245640Z",
          "iopub.status.busy": "2021-03-17T14:56:24.232936Z",
          "iopub.status.idle": "2021-03-17T14:56:24.717117Z",
          "shell.execute_reply": "2021-03-17T14:56:24.716012Z"
        },
        "papermill": {
          "duration": 0.663103,
          "end_time": "2021-03-17T14:56:24.717254",
          "exception": false,
          "start_time": "2021-03-17T14:56:24.054151",
          "status": "completed"
        },
        "tags": [],
        "id": "AzHJZPrvSBGz",
        "outputId": "a136a146-d24a-495c-c077-48577f63156f"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<AxesSubplot:xlabel='overall', ylabel='Count'>"
            ]
          },
          "execution_count": 56,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 15888 characters]\n",
            "text/plain": [
              "<Figure size 432x288 with 1 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "sns.set_theme(style=\"ticks\")\n",
        "\n",
        "\n",
        "sns.histplot(\n",
        "    dataset,\n",
        "    x=\"overall\", hue=\"race/ethnicity\",\n",
        "    multiple=\"stack\",\n",
        "    palette=\"light:m_r\",\n",
        "    edgecolor=\".2\",\n",
        "    linewidth=.5,\n",
        "    #log_scale=True,\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.165325,
          "end_time": "2021-03-17T14:56:25.046263",
          "exception": false,
          "start_time": "2021-03-17T14:56:24.880938",
          "status": "completed"
        },
        "tags": [],
        "id": "6CTGZ9rESBGz"
      },
      "source": [
        "These histograms show the distribution of students according to the value specified in the 'hue' parameter. The x-axis shows the overall score."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.167383,
          "end_time": "2021-03-17T14:56:25.380154",
          "exception": false,
          "start_time": "2021-03-17T14:56:25.212771",
          "status": "completed"
        },
        "tags": [],
        "id": "X5M6jLjhSBGz"
      },
      "source": [
        "<a id = \"27\"></a><br>\n",
        "## Ridge Plot "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "execution": {
          "iopub.execute_input": "2021-03-17T14:56:25.727163Z",
          "iopub.status.busy": "2021-03-17T14:56:25.723597Z",
          "iopub.status.idle": "2021-03-17T14:56:26.613052Z",
          "shell.execute_reply": "2021-03-17T14:56:26.612562Z"
        },
        "papermill": {
          "duration": 1.065701,
          "end_time": "2021-03-17T14:56:26.613183",
          "exception": false,
          "start_time": "2021-03-17T14:56:25.547482",
          "status": "completed"
        },
        "tags": [],
        "id": "vL8cBoD2SBGz",
        "outputId": "5e400b34-d777-4866-fd08-2bdf673dcce2"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<seaborn.axisgrid.FacetGrid at 0x7f5509b2ddd0>"
            ]
          },
          "execution_count": 57,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "[encoded data, 15480 characters]\n",
            "text/plain": [
              "<Figure size 540x180 with 5 Axes>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "###\n",
        "# Source for this code:\n",
        "# https://seaborn.pydata.org/examples/kde_ridgeplot.html\n",
        "###\n",
        "\n",
        "sns.set_theme(style=\"white\", rc={\"axes.facecolor\": (0, 0, 0, 0)})\n",
        "\n",
        "# Create the data\n",
        "\n",
        "x = dataset['overall']\n",
        "g = dataset['race/ethnicity']\n",
        "df = dataset\n",
        "\n",
        "# Initialize the FacetGrid object\n",
        "pal = sns.cubehelix_palette(10, rot=-.25, light=.7)\n",
        "g = sns.FacetGrid(dataset, row=\"race/ethnicity\", hue=\"race/ethnicity\", aspect=15, height=.5, palette=pal)\n",
        "\n",
        "# Draw the densities in a few steps\n",
        "g.map(sns.kdeplot, \n",
        "      'overall',\n",
        "      bw_adjust=.5, clip_on=False,\n",
        "      fill=True, alpha=1, \n",
        "      linewidth=1.5)\n",
        "\n",
        "#g.map(sns.kdeplot, \"overall\", clip_on=False, color=\"w\", lw=2, bw_adjust=.5)\n",
        "g.map(plt.axhline, y=0, lw=2, clip_on=False)\n",
        "\n",
        "\n",
        "# Define and use a simple function to label the plot in axes coordinates\n",
        "def label(x, color, label):\n",
        "    ax = plt.gca()\n",
        "    ax.text(0, .22, label, fontweight=\"bold\", color=color,\n",
        "            ha=\"left\", va=\"center\", transform=ax.transAxes)\n",
        "\n",
        "\n",
        "g.map(label, 'overall')\n",
        "\n",
        "# Set the subplots to overlap\n",
        "g.fig.subplots_adjust(hspace=-5)\n",
        "\n",
        "# Remove axes details that don't play well with overlap\n",
        "g.set_titles(\"\")\n",
        "g.set(yticks=[])\n",
        "g.despine(bottom=True, left=True)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "papermill": {
          "duration": 0.167195,
          "end_time": "2021-03-17T14:56:26.949526",
          "exception": false,
          "start_time": "2021-03-17T14:56:26.782331",
          "status": "completed"
        },
        "tags": [],
        "id": "j1OjRBDqSBGz"
      },
      "source": [
        "<a id = \"28\"></a><br>\n",
        "# Conclusion\n",
        "\n",
        "I tried to make an Exploratory Data Analysis on this dataset and explain my inferences. Also, I tried to explain some Seaborn graphics. Examples can be expanded. All quotations are cited.\n",
        "\n",
        "* If you have questions, please comment them. I will try to explain if you don't understand.\n",
        "* If you liked this notebook, please UPVOTE.\n",
        "* If you like my narrative style, you can take a look at the visualization work I made with the Plotly library [here](https://www.kaggle.com/bariscal/visualization-with-plotly-for-beginners). \n",
        "\n",
        "Thank you for your time."
      ]
    }
  ],
  "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.7.9"
    },
    "papermill": {
      "default_parameters": {},
      "duration": 69.25188,
      "end_time": "2021-03-17T14:56:28.029088",
      "environment_variables": {},
      "exception": null,
      "input_path": "__notebook__.ipynb",
      "output_path": "__notebook__.ipynb",
      "parameters": {},
      "start_time": "2021-03-17T14:55:18.777208",
      "version": "2.2.2"
    },
    "colab": {
      "provenance": [],
      "include_colab_link": true
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}