{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "source": [ "# Sugar Kinetics" ], "metadata": { "id": "iLEeLWoV-tpx" } }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "L96SNQ8HVI7m" }, "outputs": [], "source": [ "# imports\n", "import tensorflow as tf\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from sklearn.preprocessing import StandardScaler\n", "from imblearn.over_sampling import RandomOverSampler\n", "import seaborn as sns\n", "from sklearn.model_selection import train_test_split" ] }, { "cell_type": "code", "source": [ "# using drive to load our dataset\n", "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Ea3adROCVORJ", "outputId": "ba91f1a3-532e-49d4-b664-4b79a7c27887" }, "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Mounted at /content/drive\n" ] } ] }, { "cell_type": "code", "source": [ "df=pd.read_csv(\"/content/drive/MyDrive/dataset/diabetes.csv\")\n", "del df['Pregnancies'],df['DiabetesPedigreeFunction'],df['SkinThickness']\n", "df" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 423 }, "id": "td0NDw6QlrIk", "outputId": "39e6502d-04f4-4807-df25-9ac4bdb1d51c" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Glucose BloodPressure Insulin BMI Age Outcome\n", "0 148 72 0 33.6 50 1\n", "1 85 66 0 26.6 31 0\n", "2 183 64 0 23.3 32 1\n", "3 89 66 94 28.1 21 0\n", "4 137 40 168 43.1 33 1\n", ".. ... ... ... ... ... ...\n", "763 101 76 180 32.9 63 0\n", "764 122 70 0 36.8 27 0\n", "765 121 72 112 26.2 30 0\n", "766 126 60 0 30.1 47 1\n", "767 93 70 0 30.4 23 0\n", "\n", "[768 rows x 6 columns]" ], "text/html": [ "\n", "
\n", " | Glucose | \n", "BloodPressure | \n", "Insulin | \n", "BMI | \n", "Age | \n", "Outcome | \n", "
---|---|---|---|---|---|---|
0 | \n", "148 | \n", "72 | \n", "0 | \n", "33.6 | \n", "50 | \n", "1 | \n", "
1 | \n", "85 | \n", "66 | \n", "0 | \n", "26.6 | \n", "31 | \n", "0 | \n", "
2 | \n", "183 | \n", "64 | \n", "0 | \n", "23.3 | \n", "32 | \n", "1 | \n", "
3 | \n", "89 | \n", "66 | \n", "94 | \n", "28.1 | \n", "21 | \n", "0 | \n", "
4 | \n", "137 | \n", "40 | \n", "168 | \n", "43.1 | \n", "33 | \n", "1 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
763 | \n", "101 | \n", "76 | \n", "180 | \n", "32.9 | \n", "63 | \n", "0 | \n", "
764 | \n", "122 | \n", "70 | \n", "0 | \n", "36.8 | \n", "27 | \n", "0 | \n", "
765 | \n", "121 | \n", "72 | \n", "112 | \n", "26.2 | \n", "30 | \n", "0 | \n", "
766 | \n", "126 | \n", "60 | \n", "0 | \n", "30.1 | \n", "47 | \n", "1 | \n", "
767 | \n", "93 | \n", "70 | \n", "0 | \n", "30.4 | \n", "23 | \n", "0 | \n", "
768 rows × 6 columns
\n", "RandomForestClassifier(n_estimators=1000, random_state=1)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
RandomForestClassifier(n_estimators=1000, random_state=1)