{ "cells": [ { "cell_type": "code", "execution_count": 43, "id": "e1ab649b", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 44, "id": "fff46e1a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Pregnancies | \n", "Glucose | \n", "BloodPressure | \n", "SkinThickness | \n", "Insulin | \n", "BMI | \n", "DiabetesPedigreeFunction | \n", "Age | \n", "Outcome | \n", "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "6 | \n", "148 | \n", "72 | \n", "35 | \n", "0 | \n", "33.6 | \n", "0.627 | \n", "50 | \n", "1 | \n", "
| 1 | \n", "1 | \n", "85 | \n", "66 | \n", "29 | \n", "0 | \n", "26.6 | \n", "0.351 | \n", "31 | \n", "0 | \n", "
| 2 | \n", "8 | \n", "183 | \n", "64 | \n", "0 | \n", "0 | \n", "23.3 | \n", "0.672 | \n", "32 | \n", "1 | \n", "
| 3 | \n", "1 | \n", "89 | \n", "66 | \n", "23 | \n", "94 | \n", "28.1 | \n", "0.167 | \n", "21 | \n", "0 | \n", "
| 4 | \n", "0 | \n", "137 | \n", "40 | \n", "35 | \n", "168 | \n", "43.1 | \n", "2.288 | \n", "33 | \n", "1 | \n", "
| \n", " | Pregnancies | \n", "Glucose | \n", "BloodPressure | \n", "SkinThickness | \n", "Insulin | \n", "BMI | \n", "DiabetesPedigreeFunction | \n", "Age | \n", "Outcome | \n", "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "9 | \n", "120 | \n", "72 | \n", "22 | \n", "56 | \n", "20.8 | \n", "0.733 | \n", "48 | \n", "0 | \n", "
| 1 | \n", "1 | \n", "71 | \n", "62 | \n", "0 | \n", "0 | \n", "21.8 | \n", "0.416 | \n", "26 | \n", "0 | \n", "
| 2 | \n", "8 | \n", "74 | \n", "70 | \n", "40 | \n", "49 | \n", "35.3 | \n", "0.705 | \n", "39 | \n", "0 | \n", "
| 3 | \n", "5 | \n", "88 | \n", "78 | \n", "30 | \n", "0 | \n", "27.6 | \n", "0.258 | \n", "37 | \n", "0 | \n", "
| 4 | \n", "10 | \n", "115 | \n", "98 | \n", "0 | \n", "0 | \n", "24.0 | \n", "1.022 | \n", "34 | \n", "0 | \n", "
| \n", " | Pregnancies | \n", "Glucose | \n", "BloodPressure | \n", "SkinThickness | \n", "Insulin | \n", "BMI | \n", "DiabetesPedigreeFunction | \n", "Age | \n", "Outcome | \n", "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "6 | \n", "148 | \n", "72 | \n", "35 | \n", "0 | \n", "33.6 | \n", "0.627 | \n", "50 | \n", "1 | \n", "
| 1 | \n", "1 | \n", "85 | \n", "66 | \n", "29 | \n", "0 | \n", "26.6 | \n", "0.351 | \n", "31 | \n", "0 | \n", "
| 2 | \n", "8 | \n", "183 | \n", "64 | \n", "0 | \n", "0 | \n", "23.3 | \n", "0.672 | \n", "32 | \n", "1 | \n", "
| 3 | \n", "1 | \n", "89 | \n", "66 | \n", "23 | \n", "94 | \n", "28.1 | \n", "0.167 | \n", "21 | \n", "0 | \n", "
| 4 | \n", "0 | \n", "137 | \n", "40 | \n", "35 | \n", "168 | \n", "43.1 | \n", "2.288 | \n", "33 | \n", "1 | \n", "
| \n", " | Pregnancies | \n", "Glucose | \n", "BloodPressure | \n", "SkinThickness | \n", "Insulin | \n", "BMI | \n", "DiabetesPedigreeFunction | \n", "Age | \n", "Outcome | \n", "
|---|---|---|---|---|---|---|---|---|---|
| count | \n", "2768.000000 | \n", "2768.000000 | \n", "2768.000000 | \n", "2768.000000 | \n", "2768.000000 | \n", "2768.00000 | \n", "2768.000000 | \n", "2768.000000 | \n", "2768.000000 | \n", "
| mean | \n", "3.822616 | \n", "121.421965 | \n", "68.980491 | \n", "20.549494 | \n", "79.853324 | \n", "31.97659 | \n", "0.486277 | \n", "32.923049 | \n", "0.380419 | \n", "
| std | \n", "3.305432 | \n", "31.721258 | \n", "19.133100 | \n", "15.779713 | \n", "115.655771 | \n", "7.76054 | \n", "0.357403 | \n", "11.362964 | \n", "0.485578 | \n", "
| min | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "0.00000 | \n", "0.078000 | \n", "21.000000 | \n", "0.000000 | \n", "
| 25% | \n", "1.000000 | \n", "100.000000 | \n", "64.000000 | \n", "0.000000 | \n", "0.000000 | \n", "27.17500 | \n", "0.248000 | \n", "24.000000 | \n", "0.000000 | \n", "
| 50% | \n", "3.000000 | \n", "117.000000 | \n", "71.000000 | \n", "23.000000 | \n", "36.000000 | \n", "32.10000 | \n", "0.380000 | \n", "29.000000 | \n", "0.000000 | \n", "
| 75% | \n", "6.000000 | \n", "142.000000 | \n", "80.000000 | \n", "33.000000 | \n", "129.000000 | \n", "36.50000 | \n", "0.645250 | \n", "40.000000 | \n", "1.000000 | \n", "
| max | \n", "17.000000 | \n", "199.000000 | \n", "122.000000 | \n", "99.000000 | \n", "846.000000 | \n", "67.10000 | \n", "2.420000 | \n", "81.000000 | \n", "1.000000 | \n", "
| \n", " | Pregnancies | \n", "Glucose | \n", "BloodPressure | \n", "SkinThickness | \n", "Insulin | \n", "BMI | \n", "DiabetesPedigreeFunction | \n", "Age | \n", "Outcome | \n", "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "6 | \n", "148.0 | \n", "72.0 | \n", "35.0 | \n", "122.0 | \n", "33.6 | \n", "0.627 | \n", "50 | \n", "1 | \n", "
| 1 | \n", "1 | \n", "85.0 | \n", "66.0 | \n", "29.0 | \n", "122.0 | \n", "26.6 | \n", "0.351 | \n", "31 | \n", "0 | \n", "
| 2 | \n", "8 | \n", "183.0 | \n", "64.0 | \n", "30.0 | \n", "122.0 | \n", "23.3 | \n", "0.672 | \n", "32 | \n", "1 | \n", "
| 3 | \n", "1 | \n", "89.0 | \n", "66.0 | \n", "23.0 | \n", "94.0 | \n", "28.1 | \n", "0.167 | \n", "21 | \n", "0 | \n", "
| 4 | \n", "0 | \n", "137.0 | \n", "40.0 | \n", "35.0 | \n", "168.0 | \n", "43.1 | \n", "2.288 | \n", "33 | \n", "1 | \n", "
Pipeline(steps=[('skew', PowerTransformer()), ('scaler', StandardScaler())])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. | \n", " | \n",
" \n",
" method\n",
" method: {'yeo-johnson', 'box-cox'}, default='yeo-johnson' The power transform method. Available methods are: - 'yeo-johnson' [1]_, works with positive and negative values - 'box-cox' [2]_, only works with strictly positive values\n", " \n", " | \n",
" 'yeo-johnson' | \n", "
| \n", " | \n",
" \n",
" standardize\n",
" standardize: bool, default=True Set to True to apply zero-mean, unit-variance normalization to the transformed output.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" copy\n",
" copy: bool, default=True Set to False to perform inplace computation during transformation.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" copy\n",
" copy: bool, default=True If False, try to avoid a copy and do inplace scaling instead. This is not guaranteed to always work inplace; e.g. if the data is not a NumPy array or scipy.sparse CSR matrix, a copy may still be returned.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" with_mean\n",
" with_mean: bool, default=True If True, center the data before scaling. This does not work (and will raise an exception) when attempted on sparse matrices, because centering them entails building a dense matrix which in common use cases is likely to be too large to fit in memory.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" with_std\n",
" with_std: bool, default=True If True, scale the data to unit variance (or equivalently, unit standard deviation).\n", " \n", " | \n",
" True | \n", "
ColumnTransformer(transformers=[('num',\n",
" Pipeline(steps=[('skew', PowerTransformer()),\n",
" ('scaler', StandardScaler())]),\n",
" ['Pregnancies', 'Glucose', 'BloodPressure',\n",
" 'SkinThickness', 'Insulin', 'BMI',\n",
" 'DiabetesPedigreeFunction', 'Age'])])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. ['Pregnancies', 'Glucose', 'BloodPressure', 'SkinThickness', 'Insulin', 'BMI', 'DiabetesPedigreeFunction', 'Age']
| \n", " | \n",
" \n",
" method\n",
" method: {'yeo-johnson', 'box-cox'}, default='yeo-johnson' The power transform method. Available methods are: - 'yeo-johnson' [1]_, works with positive and negative values - 'box-cox' [2]_, only works with strictly positive values\n", " \n", " | \n",
" 'yeo-johnson' | \n", "
| \n", " | \n",
" \n",
" standardize\n",
" standardize: bool, default=True Set to True to apply zero-mean, unit-variance normalization to the transformed output.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" copy\n",
" copy: bool, default=True Set to False to perform inplace computation during transformation.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" copy\n",
" copy: bool, default=True If False, try to avoid a copy and do inplace scaling instead. This is not guaranteed to always work inplace; e.g. if the data is not a NumPy array or scipy.sparse CSR matrix, a copy may still be returned.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" with_mean\n",
" with_mean: bool, default=True If True, center the data before scaling. This does not work (and will raise an exception) when attempted on sparse matrices, because centering them entails building a dense matrix which in common use cases is likely to be too large to fit in memory.\n", " \n", " | \n",
" True | \n", "
| \n", " | \n",
" \n",
" with_std\n",
" with_std: bool, default=True If True, scale the data to unit variance (or equivalently, unit standard deviation).\n", " \n", " | \n",
" True | \n", "