{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Defaulting to user installation because normal site-packages is not writeable\n", "Requirement already satisfied: numpy in c:\\software\\python3\\lib\\site-packages (1.24.2)\n", "Requirement already satisfied: pandas in c:\\software\\python3\\lib\\site-packages (1.5.3)\n", "Requirement already satisfied: sklearn in \\\\files\\students\\s478831\\.appdata\\python\\python310\\site-packages (0.0.post4)\n", "Requirement already satisfied: xgboost in \\\\files\\students\\s478831\\.appdata\\python\\python310\\site-packages (1.7.5)\n", "Requirement already satisfied: python-dateutil>=2.8.1 in c:\\software\\python3\\lib\\site-packages (from pandas) (2.8.2)\n", "Requirement already satisfied: pytz>=2020.1 in c:\\software\\python3\\lib\\site-packages (from pandas) (2022.7.1)\n", "Requirement already satisfied: scipy in c:\\software\\python3\\lib\\site-packages (from xgboost) (1.10.1)\n", "Requirement already satisfied: six>=1.5 in c:\\software\\python3\\lib\\site-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)\n" ] } ], "source": [ "!pip install numpy pandas sklearn xgboost" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import os, sys\n", "from sklearn.preprocessing import MinMaxScaler\n", "from xgboost import XGBClassifier\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.metrics import accuracy_score" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | name | \n", "MDVP:Fo(Hz) | \n", "MDVP:Fhi(Hz) | \n", "MDVP:Flo(Hz) | \n", "MDVP:Jitter(%) | \n", "MDVP:Jitter(Abs) | \n", "MDVP:RAP | \n", "MDVP:PPQ | \n", "Jitter:DDP | \n", "MDVP:Shimmer | \n", "... | \n", "Shimmer:DDA | \n", "NHR | \n", "HNR | \n", "status | \n", "RPDE | \n", "DFA | \n", "spread1 | \n", "spread2 | \n", "D2 | \n", "PPE | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "phon_R01_S01_1 | \n", "119.992 | \n", "157.302 | \n", "74.997 | \n", "0.00784 | \n", "0.00007 | \n", "0.00370 | \n", "0.00554 | \n", "0.01109 | \n", "0.04374 | \n", "... | \n", "0.06545 | \n", "0.02211 | \n", "21.033 | \n", "1 | \n", "0.414783 | \n", "0.815285 | \n", "-4.813031 | \n", "0.266482 | \n", "2.301442 | \n", "0.284654 | \n", "
1 | \n", "phon_R01_S01_2 | \n", "122.400 | \n", "148.650 | \n", "113.819 | \n", "0.00968 | \n", "0.00008 | \n", "0.00465 | \n", "0.00696 | \n", "0.01394 | \n", "0.06134 | \n", "... | \n", "0.09403 | \n", "0.01929 | \n", "19.085 | \n", "1 | \n", "0.458359 | \n", "0.819521 | \n", "-4.075192 | \n", "0.335590 | \n", "2.486855 | \n", "0.368674 | \n", "
2 | \n", "phon_R01_S01_3 | \n", "116.682 | \n", "131.111 | \n", "111.555 | \n", "0.01050 | \n", "0.00009 | \n", "0.00544 | \n", "0.00781 | \n", "0.01633 | \n", "0.05233 | \n", "... | \n", "0.08270 | \n", "0.01309 | \n", "20.651 | \n", "1 | \n", "0.429895 | \n", "0.825288 | \n", "-4.443179 | \n", "0.311173 | \n", "2.342259 | \n", "0.332634 | \n", "
3 | \n", "phon_R01_S01_4 | \n", "116.676 | \n", "137.871 | \n", "111.366 | \n", "0.00997 | \n", "0.00009 | \n", "0.00502 | \n", "0.00698 | \n", "0.01505 | \n", "0.05492 | \n", "... | \n", "0.08771 | \n", "0.01353 | \n", "20.644 | \n", "1 | \n", "0.434969 | \n", "0.819235 | \n", "-4.117501 | \n", "0.334147 | \n", "2.405554 | \n", "0.368975 | \n", "
4 | \n", "phon_R01_S01_5 | \n", "116.014 | \n", "141.781 | \n", "110.655 | \n", "0.01284 | \n", "0.00011 | \n", "0.00655 | \n", "0.00908 | \n", "0.01966 | \n", "0.06425 | \n", "... | \n", "0.10470 | \n", "0.01767 | \n", "19.649 | \n", "1 | \n", "0.417356 | \n", "0.823484 | \n", "-3.747787 | \n", "0.234513 | \n", "2.332180 | \n", "0.410335 | \n", "
5 rows × 24 columns
\n", "XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=None, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", " colsample_bylevel=None, colsample_bynode=None,\n", " colsample_bytree=None, early_stopping_rounds=None,\n", " enable_categorical=False, eval_metric=None, feature_types=None,\n", " gamma=None, gpu_id=None, grow_policy=None, importance_type=None,\n", " interaction_constraints=None, learning_rate=None, max_bin=None,\n", " max_cat_threshold=None, max_cat_to_onehot=None,\n", " max_delta_step=None, max_depth=None, max_leaves=None,\n", " min_child_weight=None, missing=nan, monotone_constraints=None,\n", " n_estimators=100, n_jobs=None, num_parallel_tree=None,\n", " predictor=None, random_state=None, ...)