From b648df6f62de49f6aa19406af2569e94fc8201b9 Mon Sep 17 00:00:00 2001 From: Carla Fajula Date: Fri, 4 Sep 2026 12:38:40 +0200 Subject: [PATCH] solved lab --- lab-hyper-tuning.ipynb | 1319 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 1301 insertions(+), 18 deletions(-) diff --git a/lab-hyper-tuning.ipynb b/lab-hyper-tuning.ipynb index 847d487..8957787 100644 --- a/lab-hyper-tuning.ipynb +++ b/lab-hyper-tuning.ipynb @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -47,7 +47,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -200,7 +200,7 @@ "4 True " ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -219,13 +219,162 @@ "- Feature Selection\n" ] }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 8693 entries, 0 to 8692\n", + "Data columns (total 14 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 PassengerId 8693 non-null object \n", + " 1 HomePlanet 8492 non-null object \n", + " 2 CryoSleep 8476 non-null object \n", + " 3 Cabin 8494 non-null object \n", + " 4 Destination 8511 non-null object \n", + " 5 Age 8514 non-null float64\n", + " 6 VIP 8490 non-null object \n", + " 7 RoomService 8512 non-null float64\n", + " 8 FoodCourt 8510 non-null float64\n", + " 9 ShoppingMall 8485 non-null float64\n", + " 10 Spa 8510 non-null float64\n", + " 11 VRDeck 8505 non-null float64\n", + " 12 Name 8493 non-null object \n", + " 13 Transported 8693 non-null bool \n", + "dtypes: bool(1), float64(6), object(7)\n", + "memory usage: 891.5+ KB\n" + ] + } + ], + "source": [ + "spaceship.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "PassengerId 0\n", + "HomePlanet 0\n", + "CryoSleep 0\n", + "Cabin 0\n", + "Destination 0\n", + "Age 0\n", + "VIP 0\n", + "RoomService 0\n", + "FoodCourt 0\n", + "ShoppingMall 0\n", + "Spa 0\n", + "VRDeck 0\n", + "Name 0\n", + "Transported 0\n", + "dtype: int64" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spaceship = spaceship.dropna()\n", + "spaceship.isnull().sum()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array(['B', 'F', 'A', 'G', 'E', 'C', 'D', 'T'], dtype=object)" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spaceship[\"Cabin\"] = spaceship[\"Cabin\"].str.split(\"/\").str[0]\n", + "spaceship['Cabin'].unique()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "spaceship = spaceship.drop(columns =[\"PassengerId\",'Name'])" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Age float64\n", + "RoomService float64\n", + "FoodCourt float64\n", + "ShoppingMall float64\n", + "Spa float64\n", + "VRDeck float64\n", + "Transported bool\n", + "HomePlanet_Earth bool\n", + "HomePlanet_Europa bool\n", + "HomePlanet_Mars bool\n", + "CryoSleep_False bool\n", + "CryoSleep_True bool\n", + "Cabin_A bool\n", + "Cabin_B bool\n", + "Cabin_C bool\n", + "Cabin_D bool\n", + "Cabin_E bool\n", + "Cabin_F bool\n", + "Cabin_G bool\n", + "Cabin_T bool\n", + "Destination_55 Cancri e bool\n", + "Destination_PSO J318.5-22 bool\n", + "Destination_TRAPPIST-1e bool\n", + "VIP_False bool\n", + "VIP_True bool\n", + "dtype: object" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "spaceship = pd.get_dummies(spaceship)\n", + "spaceship.dtypes" + ] + }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ - "#your code here" + "features = spaceship.drop(columns=[\"Transported\"])\n", + "target = spaceship[\"Transported\"]" ] }, { @@ -237,11 +386,769 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ - "#your code here" + "X_train, X_test, y_train, y_test = train_test_split(features,target,test_size=0.20,random_state=0)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "from sklearn.preprocessing import StandardScaler\n", + "\n", + "scaler = StandardScaler()\n", + "\n", + "X_train_scaled = scaler.fit_transform(X_train)\n", + "X_test_scaled = scaler.transform(X_test)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
RandomForestClassifier()
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
" + ], + "text/plain": [ + "RandomForestClassifier()" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from sklearn.ensemble import RandomForestClassifier\n", + "random_forest = RandomForestClassifier()\n", + "random_forest.fit(X_train_scaled, y_train)" ] }, { @@ -253,11 +1160,19 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The accuracy of the Random Forest model is 78.67%\n" + ] + } + ], "source": [ - "#your code here" + "print(f\"The accuracy of the Random Forest model is {random_forest.score(X_test_scaled, y_test)*100:.2f}%\")" ] }, { @@ -283,11 +1198,15 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ - "#your code here" + "parameter_grid = {\n", + " \"max_depth\": [10, 50],\n", + " \"min_samples_split\": [4, 16],\n", + " \"max_leaf_nodes\": [250, 100],\n", + " \"max_features\": [\"sqrt\", \"log2\"]}" ] }, { @@ -299,10 +1218,348 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Fitting 10 folds for each of 16 candidates, totalling 160 fits\n", + "[CV 1/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 1/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.794 total time= 0.4s\n", + "[CV 2/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 2/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.832 total time= 0.4s\n", + "[CV 3/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 3/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.830 total time= 0.4s\n", + "[CV 4/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 4/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.805 total time= 0.7s\n", + "[CV 5/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 5/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.777 total time= 0.6s\n", + "[CV 6/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 6/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.801 total time= 0.7s\n", + "[CV 7/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 7/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.788 total time= 0.7s\n", + "[CV 8/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 8/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.778 total time= 0.6s\n", + "[CV 9/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 9/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.807 total time= 0.8s\n", + "[CV 10/10; 1/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 10/10; 1/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.790 total time= 0.7s\n", + "[CV 1/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 1/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.788 total time= 0.7s\n", + "[CV 2/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 2/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.837 total time= 0.7s\n", + "[CV 3/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 3/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.834 total time= 0.6s\n", + "[CV 4/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 4/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.803 total time= 0.7s\n", + "[CV 5/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 5/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.784 total time= 0.7s\n", + "[CV 6/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 6/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.805 total time= 0.6s\n", + "[CV 7/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 7/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.786 total time= 0.7s\n", + "[CV 8/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 8/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.782 total time= 0.6s\n", + "[CV 9/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 9/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.812 total time= 0.7s\n", + "[CV 10/10; 2/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 10/10; 2/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.792 total time= 0.6s\n", + "[CV 1/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 1/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.777 total time= 0.5s\n", + "[CV 2/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 2/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.824 total time= 0.5s\n", + "[CV 3/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 3/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.832 total time= 0.2s\n", + "[CV 4/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 4/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.803 total time= 0.3s\n", + "[CV 5/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 5/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.786 total time= 0.3s\n", + "[CV 6/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 6/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.803 total time= 0.4s\n", + "[CV 7/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 7/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.794 total time= 0.6s\n", + "[CV 8/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 8/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.782 total time= 0.6s\n", + "[CV 9/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 9/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.797 total time= 0.4s\n", + "[CV 10/10; 3/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 10/10; 3/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.778 total time= 0.7s\n", + "[CV 1/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 1/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.779 total time= 0.6s\n", + "[CV 2/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 2/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.830 total time= 0.6s\n", + "[CV 3/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 3/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.828 total time= 0.7s\n", + "[CV 4/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 4/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.803 total time= 0.6s\n", + "[CV 5/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 5/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.788 total time= 0.5s\n", + "[CV 6/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 6/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.801 total time= 0.7s\n", + "[CV 7/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 7/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.794 total time= 0.3s\n", + "[CV 8/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 8/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.782 total time= 0.2s\n", + "[CV 9/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 9/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.805 total time= 0.3s\n", + "[CV 10/10; 4/16] START max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 10/10; 4/16] END max_depth=10, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.792 total time= 0.2s\n", + "[CV 1/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 1/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.790 total time= 0.3s\n", + "[CV 2/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 2/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.826 total time= 0.2s\n", + "[CV 3/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 3/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.834 total time= 0.2s\n", + "[CV 4/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 4/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.805 total time= 0.3s\n", + "[CV 5/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 5/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.780 total time= 0.3s\n", + "[CV 6/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 6/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.801 total time= 0.3s\n", + "[CV 7/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 7/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.784 total time= 0.6s\n", + "[CV 8/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 8/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.784 total time= 0.6s\n", + "[CV 9/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 9/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.807 total time= 0.8s\n", + "[CV 10/10; 5/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 10/10; 5/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.792 total time= 0.6s\n", + "[CV 1/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 1/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.788 total time= 0.6s\n", + "[CV 2/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 2/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.836 total time= 0.3s\n", + "[CV 3/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 3/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.839 total time= 0.2s\n", + "[CV 4/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 4/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.803 total time= 0.3s\n", + "[CV 5/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 5/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.786 total time= 0.3s\n", + "[CV 6/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 6/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.805 total time= 0.7s\n", + "[CV 7/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 7/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.795 total time= 0.7s\n", + "[CV 8/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 8/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.775 total time= 0.5s\n", + "[CV 9/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 9/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.803 total time= 0.7s\n", + "[CV 10/10; 6/16] START max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 10/10; 6/16] END max_depth=10, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.780 total time= 0.4s\n", + "[CV 1/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 1/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.777 total time= 0.5s\n", + "[CV 2/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 2/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.824 total time= 0.3s\n", + "[CV 3/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 3/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.826 total time= 0.4s\n", + "[CV 4/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 4/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.809 total time= 0.6s\n", + "[CV 5/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 5/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.786 total time= 0.6s\n", + "[CV 6/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 6/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.803 total time= 0.7s\n", + "[CV 7/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 7/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.794 total time= 0.5s\n", + "[CV 8/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 8/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.777 total time= 0.4s\n", + "[CV 9/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 9/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.807 total time= 0.5s\n", + "[CV 10/10; 7/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 10/10; 7/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.782 total time= 0.5s\n", + "[CV 1/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 1/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.783 total time= 0.4s\n", + "[CV 2/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 2/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.828 total time= 0.6s\n", + "[CV 3/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 3/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.837 total time= 0.5s\n", + "[CV 4/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 4/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.807 total time= 0.5s\n", + "[CV 5/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 5/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.790 total time= 0.5s\n", + "[CV 6/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 6/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.809 total time= 0.5s\n", + "[CV 7/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 7/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.790 total time= 0.6s\n", + "[CV 8/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 8/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.777 total time= 0.5s\n", + "[CV 9/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 9/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.803 total time= 0.3s\n", + "[CV 10/10; 8/16] START max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 10/10; 8/16] END max_depth=10, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.788 total time= 0.2s\n", + "[CV 1/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 1/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.783 total time= 0.3s\n", + "[CV 2/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 2/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.817 total time= 0.3s\n", + "[CV 3/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 3/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.820 total time= 0.5s\n", + "[CV 4/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 4/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.802 total time= 0.8s\n", + "[CV 5/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 5/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.780 total time= 0.5s\n", + "[CV 6/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 6/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.814 total time= 0.7s\n", + "[CV 7/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 7/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.795 total time= 0.5s\n", + "[CV 8/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 8/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.784 total time= 0.6s\n", + "[CV 9/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 9/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.801 total time= 0.5s\n", + "[CV 10/10; 9/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 10/10; 9/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=4;, score=0.786 total time= 0.6s\n", + "[CV 1/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 1/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.798 total time= 0.4s\n", + "[CV 2/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 2/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.820 total time= 0.4s\n", + "[CV 3/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 3/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.807 total time= 0.4s\n", + "[CV 4/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 4/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.807 total time= 0.4s\n", + "[CV 5/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 5/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.792 total time= 0.4s\n", + "[CV 6/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 6/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.807 total time= 0.7s\n", + "[CV 7/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 7/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.786 total time= 0.8s\n", + "[CV 8/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 8/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.777 total time= 0.7s\n", + "[CV 9/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 9/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.805 total time= 0.7s\n", + "[CV 10/10; 10/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 10/10; 10/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=250, min_samples_split=16;, score=0.786 total time= 0.6s\n", + "[CV 1/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 1/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.777 total time= 0.6s\n", + "[CV 2/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 2/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.830 total time= 0.6s\n", + "[CV 3/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 3/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.822 total time= 0.5s\n", + "[CV 4/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 4/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.803 total time= 0.5s\n", + "[CV 5/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 5/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.799 total time= 0.2s\n", + "[CV 6/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 6/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.799 total time= 0.3s\n", + "[CV 7/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 7/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.797 total time= 0.3s\n", + "[CV 8/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 8/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.790 total time= 0.2s\n", + "[CV 9/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 9/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.805 total time= 0.3s\n", + "[CV 10/10; 11/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 10/10; 11/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=4;, score=0.794 total time= 0.3s\n", + "[CV 1/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 1/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.783 total time= 0.2s\n", + "[CV 2/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 2/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.828 total time= 0.4s\n", + "[CV 3/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 3/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.826 total time= 0.5s\n", + "[CV 4/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 4/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.802 total time= 0.7s\n", + "[CV 5/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 5/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.797 total time= 0.6s\n", + "[CV 6/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 6/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.797 total time= 0.4s\n", + "[CV 7/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 7/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.801 total time= 0.6s\n", + "[CV 8/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 8/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.784 total time= 0.5s\n", + "[CV 9/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 9/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.803 total time= 0.5s\n", + "[CV 10/10; 12/16] START max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 10/10; 12/16] END max_depth=50, max_features=sqrt, max_leaf_nodes=100, min_samples_split=16;, score=0.795 total time= 0.5s\n", + "[CV 1/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 1/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.788 total time= 0.6s\n", + "[CV 2/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 2/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.809 total time= 0.6s\n", + "[CV 3/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 3/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.828 total time= 0.8s\n", + "[CV 4/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 4/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.807 total time= 0.5s\n", + "[CV 5/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 5/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.777 total time= 0.7s\n", + "[CV 6/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 6/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.799 total time= 0.7s\n", + "[CV 7/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 7/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.794 total time= 0.6s\n", + "[CV 8/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 8/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.777 total time= 0.6s\n", + "[CV 9/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 9/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.803 total time= 0.6s\n", + "[CV 10/10; 13/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4\n", + "[CV 10/10; 13/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=4;, score=0.778 total time= 0.4s\n", + "[CV 1/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 1/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.784 total time= 0.6s\n", + "[CV 2/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 2/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.817 total time= 0.3s\n", + "[CV 3/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 3/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.813 total time= 0.3s\n", + "[CV 4/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 4/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.807 total time= 0.3s\n", + "[CV 5/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 5/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.803 total time= 0.5s\n", + "[CV 6/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 6/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.805 total time= 0.8s\n", + "[CV 7/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 7/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.794 total time= 0.6s\n", + "[CV 8/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 8/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.773 total time= 0.7s\n", + "[CV 9/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 9/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.801 total time= 0.5s\n", + "[CV 10/10; 14/16] START max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16\n", + "[CV 10/10; 14/16] END max_depth=50, max_features=log2, max_leaf_nodes=250, min_samples_split=16;, score=0.790 total time= 0.3s\n", + "[CV 1/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 1/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.779 total time= 0.3s\n", + "[CV 2/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 2/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.826 total time= 0.3s\n", + "[CV 3/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 3/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.826 total time= 0.2s\n", + "[CV 4/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 4/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.798 total time= 0.2s\n", + "[CV 5/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 5/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.792 total time= 0.2s\n", + "[CV 6/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 6/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.797 total time= 0.2s\n", + "[CV 7/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 7/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.782 total time= 0.2s\n", + "[CV 8/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 8/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.792 total time= 0.3s\n", + "[CV 9/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 9/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.809 total time= 0.2s\n", + "[CV 10/10; 15/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4\n", + "[CV 10/10; 15/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=4;, score=0.790 total time= 0.2s\n", + "[CV 1/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 1/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.784 total time= 0.3s\n", + "[CV 2/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 2/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.826 total time= 0.2s\n", + "[CV 3/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 3/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.820 total time= 0.4s\n", + "[CV 4/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 4/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.798 total time= 0.6s\n", + "[CV 5/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 5/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.788 total time= 0.5s\n", + "[CV 6/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 6/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.801 total time= 0.5s\n", + "[CV 7/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 7/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.801 total time= 0.6s\n", + "[CV 8/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 8/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.784 total time= 0.6s\n", + "[CV 9/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 9/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.811 total time= 0.6s\n", + "[CV 10/10; 16/16] START max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16\n", + "[CV 10/10; 16/16] END max_depth=50, max_features=log2, max_leaf_nodes=100, min_samples_split=16;, score=0.784 total time= 0.7s\n", + "The best combination of hyperparameters has been: {'max_depth': 10, 'max_features': 'sqrt', 'max_leaf_nodes': 250, 'min_samples_split': 16}\n", + "The best accuracy is: 0.8024\n" + ] + } + ], + "source": [ + "from sklearn.model_selection import GridSearchCV\n", + "\n", + "grid_search = GridSearchCV(random_forest,param_grid=parameter_grid,cv=10,scoring=\"accuracy\",verbose=10)\n", + "grid_search.fit(X_train_scaled, y_train)\n", + "\n", + "print(f\"The best combination of hyperparameters has been: {grid_search.best_params_}\")\n", + "print(f\"The best accuracy is: {grid_search.best_score_:.4f}\")" + ] }, { "cell_type": "markdown", @@ -311,6 +1568,32 @@ "- Evaluate your model" ] }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The accuracy of the tuned Random Forest model is 78.82%\n" + ] + } + ], + "source": [ + "best_model = grid_search.best_estimator_\n", + "\n", + "print(f\"The accuracy of the tuned Random Forest model is {best_model.score(X_test_scaled, y_test)*100:.2f}%\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The tuned Random Forest slightly improves the previous model, increasing the test accuracy from 78.74% to 78.82%. However, the improvement is very small." + ] + }, { "cell_type": "code", "execution_count": null, @@ -321,9 +1604,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python [conda env:base] *", "language": "python", - "name": "python3" + "name": "conda-base-py" }, "language_info": { "codemirror_mode": { @@ -335,9 +1618,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.13.9" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }