├── Hyper Parameter Optimization.ipynb ├── README.md └── diabetes.csv /Hyper Parameter Optimization.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "### All Techniques Of Hyper Parameter Optimization\n", 8 | "\n", 9 | "1. GridSearchCV\n", 10 | "2. RandomizedSearchCV\n", 11 | "3. Bayesian Optimization -Automate Hyperparameter Tuning (Hyperopt)\n", 12 | "4. Sequential Model Based Optimization(Tuning a scikit-learn estimator with skopt)\n", 13 | "4. Optuna- Automate Hyperparameter Tuning\n", 14 | "5. Genetic Algorithms (TPOT Classifier)\n", 15 | "\n", 16 | "###### References\n", 17 | "- https://github.com/fmfn/BayesianOptimization\n", 18 | "- https://github.com/hyperopt/hyperopt\n", 19 | "- https://www.jeremyjordan.me/hyperparameter-tuning/\n", 20 | "- https://optuna.org/\n", 21 | "- https://towardsdatascience.com/hyperparameters-optimization-526348bb8e2d(By Pier Paolo Ippolito )\n", 22 | "- https://scikit-optimize.github.io/stable/auto_examples/hyperparameter-optimization.html\n" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 1, 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "import warnings\n", 32 | "warnings.filterwarnings('ignore')" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 2, 38 | "metadata": {}, 39 | "outputs": [ 40 | { 41 | "data": { 42 | "text/html": [ 43 | "
\n", 44 | "\n", 57 | "\n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | "
PregnanciesGlucoseBloodPressureSkinThicknessInsulinBMIDiabetesPedigreeFunctionAgeOutcome
061487235033.60.627501
11856629026.60.351310
28183640023.30.672321
318966239428.10.167210
40137403516843.12.288331
\n", 135 | "
" 136 | ], 137 | "text/plain": [ 138 | " Pregnancies Glucose BloodPressure SkinThickness Insulin BMI \\\n", 139 | "0 6 148 72 35 0 33.6 \n", 140 | "1 1 85 66 29 0 26.6 \n", 141 | "2 8 183 64 0 0 23.3 \n", 142 | "3 1 89 66 23 94 28.1 \n", 143 | "4 0 137 40 35 168 43.1 \n", 144 | "\n", 145 | " DiabetesPedigreeFunction Age Outcome \n", 146 | "0 0.627 50 1 \n", 147 | "1 0.351 31 0 \n", 148 | "2 0.672 32 1 \n", 149 | "3 0.167 21 0 \n", 150 | "4 2.288 33 1 " 151 | ] 152 | }, 153 | "execution_count": 2, 154 | "metadata": {}, 155 | "output_type": "execute_result" 156 | } 157 | ], 158 | "source": [ 159 | "import pandas as pd\n", 160 | "df=pd.read_csv('diabetes.csv')\n", 161 | "df.head()" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": 3, 167 | "metadata": {}, 168 | "outputs": [ 169 | { 170 | "data": { 171 | "text/html": [ 172 | "
\n", 173 | "\n", 186 | "\n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | "
PregnanciesGlucoseBloodPressureSkinThicknessInsulinBMIDiabetesPedigreeFunctionAgeOutcome
06148.07235033.60.627501
1185.06629026.60.351310
28183.0640023.30.672321
3189.066239428.10.167210
40137.0403516843.12.288331
\n", 264 | "
" 265 | ], 266 | "text/plain": [ 267 | " Pregnancies Glucose BloodPressure SkinThickness Insulin BMI \\\n", 268 | "0 6 148.0 72 35 0 33.6 \n", 269 | "1 1 85.0 66 29 0 26.6 \n", 270 | "2 8 183.0 64 0 0 23.3 \n", 271 | "3 1 89.0 66 23 94 28.1 \n", 272 | "4 0 137.0 40 35 168 43.1 \n", 273 | "\n", 274 | " DiabetesPedigreeFunction Age Outcome \n", 275 | "0 0.627 50 1 \n", 276 | "1 0.351 31 0 \n", 277 | "2 0.672 32 1 \n", 278 | "3 0.167 21 0 \n", 279 | "4 2.288 33 1 " 280 | ] 281 | }, 282 | "execution_count": 3, 283 | "metadata": {}, 284 | "output_type": "execute_result" 285 | } 286 | ], 287 | "source": [ 288 | "import numpy as np\n", 289 | "df['Glucose']=np.where(df['Glucose']==0,df['Glucose'].median(),df['Glucose'])\n", 290 | "df.head()" 291 | ] 292 | }, 293 | { 294 | "cell_type": "code", 295 | "execution_count": 4, 296 | "metadata": {}, 297 | "outputs": [], 298 | "source": [ 299 | "#### Independent And Dependent features\n", 300 | "X=df.drop('Outcome',axis=1)\n", 301 | "y=df['Outcome']" 302 | ] 303 | }, 304 | { 305 | "cell_type": "code", 306 | "execution_count": 5, 307 | "metadata": {}, 308 | "outputs": [ 309 | { 310 | "data": { 311 | "text/html": [ 312 | "
\n", 313 | "\n", 326 | "\n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | "
PregnanciesGlucoseBloodPressureSkinThicknessInsulinBMIDiabetesPedigreeFunctionAge
06148.07235033.60.62750
1185.06629026.60.35131
28183.0640023.30.67232
3189.066239428.10.16721
40137.0403516843.12.28833
...........................
76310101.0764818032.90.17163
7642122.07027036.80.34027
7655121.0722311226.20.24530
7661126.0600030.10.34947
767193.07031030.40.31523
\n", 464 | "

768 rows × 8 columns

\n", 465 | "
" 466 | ], 467 | "text/plain": [ 468 | " Pregnancies Glucose BloodPressure SkinThickness Insulin BMI \\\n", 469 | "0 6 148.0 72 35 0 33.6 \n", 470 | "1 1 85.0 66 29 0 26.6 \n", 471 | "2 8 183.0 64 0 0 23.3 \n", 472 | "3 1 89.0 66 23 94 28.1 \n", 473 | "4 0 137.0 40 35 168 43.1 \n", 474 | ".. ... ... ... ... ... ... \n", 475 | "763 10 101.0 76 48 180 32.9 \n", 476 | "764 2 122.0 70 27 0 36.8 \n", 477 | "765 5 121.0 72 23 112 26.2 \n", 478 | "766 1 126.0 60 0 0 30.1 \n", 479 | "767 1 93.0 70 31 0 30.4 \n", 480 | "\n", 481 | " DiabetesPedigreeFunction Age \n", 482 | "0 0.627 50 \n", 483 | "1 0.351 31 \n", 484 | "2 0.672 32 \n", 485 | "3 0.167 21 \n", 486 | "4 2.288 33 \n", 487 | ".. ... ... \n", 488 | "763 0.171 63 \n", 489 | "764 0.340 27 \n", 490 | "765 0.245 30 \n", 491 | "766 0.349 47 \n", 492 | "767 0.315 23 \n", 493 | "\n", 494 | "[768 rows x 8 columns]" 495 | ] 496 | }, 497 | "execution_count": 5, 498 | "metadata": {}, 499 | "output_type": "execute_result" 500 | } 501 | ], 502 | "source": [ 503 | "pd.DataFrame(X,columns=df.columns[:-1])" 504 | ] 505 | }, 506 | { 507 | "cell_type": "code", 508 | "execution_count": 6, 509 | "metadata": {}, 510 | "outputs": [], 511 | "source": [ 512 | "#### Train Test Split\n", 513 | "from sklearn.model_selection import train_test_split\n", 514 | "X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.20,random_state=0)" 515 | ] 516 | }, 517 | { 518 | "cell_type": "code", 519 | "execution_count": 7, 520 | "metadata": {}, 521 | "outputs": [], 522 | "source": [ 523 | "from sklearn.ensemble import RandomForestClassifier\n", 524 | "rf_classifier=RandomForestClassifier(n_estimators=10).fit(X_train,y_train)\n", 525 | "prediction=rf_classifier.predict(X_test)" 526 | ] 527 | }, 528 | { 529 | "cell_type": "code", 530 | "execution_count": 8, 531 | "metadata": {}, 532 | "outputs": [ 533 | { 534 | "data": { 535 | "text/plain": [ 536 | "0 500\n", 537 | "1 268\n", 538 | "Name: Outcome, dtype: int64" 539 | ] 540 | }, 541 | "execution_count": 8, 542 | "metadata": {}, 543 | "output_type": "execute_result" 544 | } 545 | ], 546 | "source": [ 547 | "y.value_counts()" 548 | ] 549 | }, 550 | { 551 | "cell_type": "code", 552 | "execution_count": 9, 553 | "metadata": {}, 554 | "outputs": [ 555 | { 556 | "name": "stdout", 557 | "output_type": "stream", 558 | "text": [ 559 | "[[90 17]\n", 560 | " [22 25]]\n", 561 | "0.7467532467532467\n", 562 | " precision recall f1-score support\n", 563 | "\n", 564 | " 0 0.80 0.84 0.82 107\n", 565 | " 1 0.60 0.53 0.56 47\n", 566 | "\n", 567 | " accuracy 0.75 154\n", 568 | " macro avg 0.70 0.69 0.69 154\n", 569 | "weighted avg 0.74 0.75 0.74 154\n", 570 | "\n" 571 | ] 572 | } 573 | ], 574 | "source": [ 575 | "from sklearn.metrics import confusion_matrix,classification_report,accuracy_score\n", 576 | "print(confusion_matrix(y_test,prediction))\n", 577 | "print(accuracy_score(y_test,prediction))\n", 578 | "print(classification_report(y_test,prediction))" 579 | ] 580 | }, 581 | { 582 | "cell_type": "markdown", 583 | "metadata": {}, 584 | "source": [ 585 | "The main parameters used by a Random Forest Classifier are:\n", 586 | "\n", 587 | "- criterion = the function used to evaluate the quality of a split.\n", 588 | "- max_depth = maximum number of levels allowed in each tree.\n", 589 | "- max_features = maximum number of features considered when splitting a node.\n", 590 | "- min_samples_leaf = minimum number of samples which can be stored in a tree leaf.\n", 591 | "- min_samples_split = minimum number of samples necessary in a node to cause node splitting.\n", 592 | "- n_estimators = number of trees in the ensamble." 593 | ] 594 | }, 595 | { 596 | "cell_type": "code", 597 | "execution_count": 10, 598 | "metadata": {}, 599 | "outputs": [ 600 | { 601 | "name": "stdout", 602 | "output_type": "stream", 603 | "text": [ 604 | "[[98 9]\n", 605 | " [18 29]]\n", 606 | "0.8246753246753247\n", 607 | " precision recall f1-score support\n", 608 | "\n", 609 | " 0 0.84 0.92 0.88 107\n", 610 | " 1 0.76 0.62 0.68 47\n", 611 | "\n", 612 | " accuracy 0.82 154\n", 613 | " macro avg 0.80 0.77 0.78 154\n", 614 | "weighted avg 0.82 0.82 0.82 154\n", 615 | "\n" 616 | ] 617 | } 618 | ], 619 | "source": [ 620 | "### Manual Hyperparameter Tuning\n", 621 | "model=RandomForestClassifier(n_estimators=300,criterion='entropy',\n", 622 | " max_features='sqrt',min_samples_leaf=10,random_state=100).fit(X_train,y_train)\n", 623 | "predictions=model.predict(X_test)\n", 624 | "print(confusion_matrix(y_test,predictions))\n", 625 | "print(accuracy_score(y_test,predictions))\n", 626 | "print(classification_report(y_test,predictions))" 627 | ] 628 | }, 629 | { 630 | "cell_type": "markdown", 631 | "metadata": {}, 632 | "source": [ 633 | "##### Randomized Search Cv" 634 | ] 635 | }, 636 | { 637 | "cell_type": "code", 638 | "execution_count": 11, 639 | "metadata": {}, 640 | "outputs": [ 641 | { 642 | "name": "stdout", 643 | "output_type": "stream", 644 | "text": [ 645 | "{'n_estimators': [200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000], 'max_features': ['auto', 'sqrt', 'log2'], 'max_depth': [10, 120, 230, 340, 450, 560, 670, 780, 890, 1000], 'min_samples_split': [2, 5, 10, 14], 'min_samples_leaf': [1, 2, 4, 6, 8], 'criterion': ['entropy', 'gini']}\n" 646 | ] 647 | } 648 | ], 649 | "source": [ 650 | "import numpy as np\n", 651 | "from sklearn.model_selection import RandomizedSearchCV\n", 652 | "# Number of trees in random forest\n", 653 | "n_estimators = [int(x) for x in np.linspace(start = 200, stop = 2000, num = 10)]\n", 654 | "# Number of features to consider at every split\n", 655 | "max_features = ['auto', 'sqrt','log2']\n", 656 | "# Maximum number of levels in tree\n", 657 | "max_depth = [int(x) for x in np.linspace(10, 1000,10)]\n", 658 | "# Minimum number of samples required to split a node\n", 659 | "min_samples_split = [2, 5, 10,14]\n", 660 | "# Minimum number of samples required at each leaf node\n", 661 | "min_samples_leaf = [1, 2, 4,6,8]\n", 662 | "# Create the random grid\n", 663 | "random_grid = {'n_estimators': n_estimators,\n", 664 | " 'max_features': max_features,\n", 665 | " 'max_depth': max_depth,\n", 666 | " 'min_samples_split': min_samples_split,\n", 667 | " 'min_samples_leaf': min_samples_leaf,\n", 668 | " 'criterion':['entropy','gini']}\n", 669 | "print(random_grid)" 670 | ] 671 | }, 672 | { 673 | "cell_type": "code", 674 | "execution_count": 12, 675 | "metadata": {}, 676 | "outputs": [ 677 | { 678 | "name": "stdout", 679 | "output_type": "stream", 680 | "text": [ 681 | "Fitting 3 folds for each of 100 candidates, totalling 300 fits\n" 682 | ] 683 | }, 684 | { 685 | "name": "stderr", 686 | "output_type": "stream", 687 | "text": [ 688 | "[Parallel(n_jobs=-1)]: Using backend LokyBackend with 12 concurrent workers.\n", 689 | "[Parallel(n_jobs=-1)]: Done 17 tasks | elapsed: 7.5s\n", 690 | "[Parallel(n_jobs=-1)]: Done 138 tasks | elapsed: 39.4s\n", 691 | "[Parallel(n_jobs=-1)]: Done 300 out of 300 | elapsed: 1.5min finished\n" 692 | ] 693 | }, 694 | { 695 | "data": { 696 | "text/plain": [ 697 | "RandomizedSearchCV(cv=3, estimator=RandomForestClassifier(), n_iter=100,\n", 698 | " n_jobs=-1,\n", 699 | " param_distributions={'criterion': ['entropy', 'gini'],\n", 700 | " 'max_depth': [10, 120, 230, 340, 450,\n", 701 | " 560, 670, 780, 890,\n", 702 | " 1000],\n", 703 | " 'max_features': ['auto', 'sqrt',\n", 704 | " 'log2'],\n", 705 | " 'min_samples_leaf': [1, 2, 4, 6, 8],\n", 706 | " 'min_samples_split': [2, 5, 10, 14],\n", 707 | " 'n_estimators': [200, 400, 600, 800,\n", 708 | " 1000, 1200, 1400, 1600,\n", 709 | " 1800, 2000]},\n", 710 | " random_state=100, verbose=2)" 711 | ] 712 | }, 713 | "execution_count": 12, 714 | "metadata": {}, 715 | "output_type": "execute_result" 716 | } 717 | ], 718 | "source": [ 719 | "rf=RandomForestClassifier()\n", 720 | "rf_randomcv=RandomizedSearchCV(estimator=rf,param_distributions=random_grid,n_iter=100,cv=3,verbose=2,\n", 721 | " random_state=100,n_jobs=-1)\n", 722 | "### fit the randomized model\n", 723 | "rf_randomcv.fit(X_train,y_train)" 724 | ] 725 | }, 726 | { 727 | "cell_type": "code", 728 | "execution_count": 13, 729 | "metadata": {}, 730 | "outputs": [ 731 | { 732 | "data": { 733 | "text/plain": [ 734 | "{'n_estimators': 200,\n", 735 | " 'min_samples_split': 5,\n", 736 | " 'min_samples_leaf': 1,\n", 737 | " 'max_features': 'log2',\n", 738 | " 'max_depth': 450,\n", 739 | " 'criterion': 'gini'}" 740 | ] 741 | }, 742 | "execution_count": 13, 743 | "metadata": {}, 744 | "output_type": "execute_result" 745 | } 746 | ], 747 | "source": [ 748 | "rf_randomcv.best_params_" 749 | ] 750 | }, 751 | { 752 | "cell_type": "code", 753 | "execution_count": 14, 754 | "metadata": {}, 755 | "outputs": [ 756 | { 757 | "data": { 758 | "text/plain": [ 759 | "RandomizedSearchCV(cv=3, estimator=RandomForestClassifier(), n_iter=100,\n", 760 | " n_jobs=-1,\n", 761 | " param_distributions={'criterion': ['entropy', 'gini'],\n", 762 | " 'max_depth': [10, 120, 230, 340, 450,\n", 763 | " 560, 670, 780, 890,\n", 764 | " 1000],\n", 765 | " 'max_features': ['auto', 'sqrt',\n", 766 | " 'log2'],\n", 767 | " 'min_samples_leaf': [1, 2, 4, 6, 8],\n", 768 | " 'min_samples_split': [2, 5, 10, 14],\n", 769 | " 'n_estimators': [200, 400, 600, 800,\n", 770 | " 1000, 1200, 1400, 1600,\n", 771 | " 1800, 2000]},\n", 772 | " random_state=100, verbose=2)" 773 | ] 774 | }, 775 | "execution_count": 14, 776 | "metadata": {}, 777 | "output_type": "execute_result" 778 | } 779 | ], 780 | "source": [ 781 | "rf_randomcv" 782 | ] 783 | }, 784 | { 785 | "cell_type": "code", 786 | "execution_count": 15, 787 | "metadata": {}, 788 | "outputs": [], 789 | "source": [ 790 | "best_random_grid=rf_randomcv.best_estimator_" 791 | ] 792 | }, 793 | { 794 | "cell_type": "code", 795 | "execution_count": 16, 796 | "metadata": {}, 797 | "outputs": [ 798 | { 799 | "name": "stdout", 800 | "output_type": "stream", 801 | "text": [ 802 | "[[93 14]\n", 803 | " [15 32]]\n", 804 | "Accuracy Score 0.8116883116883117\n", 805 | "Classification report: precision recall f1-score support\n", 806 | "\n", 807 | " 0 0.86 0.87 0.87 107\n", 808 | " 1 0.70 0.68 0.69 47\n", 809 | "\n", 810 | " accuracy 0.81 154\n", 811 | " macro avg 0.78 0.78 0.78 154\n", 812 | "weighted avg 0.81 0.81 0.81 154\n", 813 | "\n" 814 | ] 815 | } 816 | ], 817 | "source": [ 818 | "from sklearn.metrics import accuracy_score\n", 819 | "y_pred=best_random_grid.predict(X_test)\n", 820 | "print(confusion_matrix(y_test,y_pred))\n", 821 | "print(\"Accuracy Score {}\".format(accuracy_score(y_test,y_pred)))\n", 822 | "print(\"Classification report: {}\".format(classification_report(y_test,y_pred)))" 823 | ] 824 | }, 825 | { 826 | "cell_type": "markdown", 827 | "metadata": {}, 828 | "source": [ 829 | "#### GridSearch CV" 830 | ] 831 | }, 832 | { 833 | "cell_type": "code", 834 | "execution_count": 17, 835 | "metadata": {}, 836 | "outputs": [ 837 | { 838 | "data": { 839 | "text/plain": [ 840 | "{'n_estimators': 200,\n", 841 | " 'min_samples_split': 5,\n", 842 | " 'min_samples_leaf': 1,\n", 843 | " 'max_features': 'log2',\n", 844 | " 'max_depth': 450,\n", 845 | " 'criterion': 'gini'}" 846 | ] 847 | }, 848 | "execution_count": 17, 849 | "metadata": {}, 850 | "output_type": "execute_result" 851 | } 852 | ], 853 | "source": [ 854 | "rf_randomcv.best_params_" 855 | ] 856 | }, 857 | { 858 | "cell_type": "code", 859 | "execution_count": 18, 860 | "metadata": {}, 861 | "outputs": [ 862 | { 863 | "name": "stdout", 864 | "output_type": "stream", 865 | "text": [ 866 | "{'criterion': ['gini'], 'max_depth': [450], 'max_features': ['log2'], 'min_samples_leaf': [1, 3, 5], 'min_samples_split': [3, 4, 5, 6, 7], 'n_estimators': [0, 100, 200, 300, 400]}\n" 867 | ] 868 | } 869 | ], 870 | "source": [ 871 | "from sklearn.model_selection import GridSearchCV\n", 872 | "\n", 873 | "param_grid = {\n", 874 | " 'criterion': [rf_randomcv.best_params_['criterion']],\n", 875 | " 'max_depth': [rf_randomcv.best_params_['max_depth']],\n", 876 | " 'max_features': [rf_randomcv.best_params_['max_features']],\n", 877 | " 'min_samples_leaf': [rf_randomcv.best_params_['min_samples_leaf'], \n", 878 | " rf_randomcv.best_params_['min_samples_leaf']+2, \n", 879 | " rf_randomcv.best_params_['min_samples_leaf'] + 4],\n", 880 | " 'min_samples_split': [rf_randomcv.best_params_['min_samples_split'] - 2,\n", 881 | " rf_randomcv.best_params_['min_samples_split'] - 1,\n", 882 | " rf_randomcv.best_params_['min_samples_split'], \n", 883 | " rf_randomcv.best_params_['min_samples_split'] +1,\n", 884 | " rf_randomcv.best_params_['min_samples_split'] + 2],\n", 885 | " 'n_estimators': [rf_randomcv.best_params_['n_estimators'] - 200, rf_randomcv.best_params_['n_estimators'] - 100, \n", 886 | " rf_randomcv.best_params_['n_estimators'], \n", 887 | " rf_randomcv.best_params_['n_estimators'] + 100, rf_randomcv.best_params_['n_estimators'] + 200]\n", 888 | "}\n", 889 | "\n", 890 | "print(param_grid)" 891 | ] 892 | }, 893 | { 894 | "cell_type": "code", 895 | "execution_count": 19, 896 | "metadata": {}, 897 | "outputs": [ 898 | { 899 | "name": "stdout", 900 | "output_type": "stream", 901 | "text": [ 902 | "Fitting 10 folds for each of 75 candidates, totalling 750 fits\n" 903 | ] 904 | }, 905 | { 906 | "name": "stderr", 907 | "output_type": "stream", 908 | "text": [ 909 | "[Parallel(n_jobs=-1)]: Using backend LokyBackend with 12 concurrent workers.\n", 910 | "[Parallel(n_jobs=-1)]: Done 17 tasks | elapsed: 0.3s\n", 911 | "[Parallel(n_jobs=-1)]: Done 186 tasks | elapsed: 9.5s\n", 912 | "[Parallel(n_jobs=-1)]: Done 389 tasks | elapsed: 20.1s\n", 913 | "[Parallel(n_jobs=-1)]: Done 672 tasks | elapsed: 35.0s\n", 914 | "[Parallel(n_jobs=-1)]: Done 750 out of 750 | elapsed: 39.8s finished\n" 915 | ] 916 | }, 917 | { 918 | "data": { 919 | "text/plain": [ 920 | "GridSearchCV(cv=10, estimator=RandomForestClassifier(), n_jobs=-1,\n", 921 | " param_grid={'criterion': ['gini'], 'max_depth': [450],\n", 922 | " 'max_features': ['log2'],\n", 923 | " 'min_samples_leaf': [1, 3, 5],\n", 924 | " 'min_samples_split': [3, 4, 5, 6, 7],\n", 925 | " 'n_estimators': [0, 100, 200, 300, 400]},\n", 926 | " verbose=2)" 927 | ] 928 | }, 929 | "execution_count": 19, 930 | "metadata": {}, 931 | "output_type": "execute_result" 932 | } 933 | ], 934 | "source": [ 935 | "#### Fit the grid_search to the data\n", 936 | "rf=RandomForestClassifier()\n", 937 | "grid_search=GridSearchCV(estimator=rf,param_grid=param_grid,cv=10,n_jobs=-1,verbose=2)\n", 938 | "grid_search.fit(X_train,y_train)\n" 939 | ] 940 | }, 941 | { 942 | "cell_type": "code", 943 | "execution_count": 20, 944 | "metadata": {}, 945 | "outputs": [ 946 | { 947 | "data": { 948 | "text/plain": [ 949 | "RandomForestClassifier(max_depth=450, max_features='log2', min_samples_leaf=3,\n", 950 | " min_samples_split=3)" 951 | ] 952 | }, 953 | "execution_count": 20, 954 | "metadata": {}, 955 | "output_type": "execute_result" 956 | } 957 | ], 958 | "source": [ 959 | "grid_search.best_estimator_" 960 | ] 961 | }, 962 | { 963 | "cell_type": "code", 964 | "execution_count": 21, 965 | "metadata": {}, 966 | "outputs": [], 967 | "source": [ 968 | "best_grid=grid_search.best_estimator_" 969 | ] 970 | }, 971 | { 972 | "cell_type": "code", 973 | "execution_count": 22, 974 | "metadata": {}, 975 | "outputs": [ 976 | { 977 | "data": { 978 | "text/plain": [ 979 | "RandomForestClassifier(max_depth=450, max_features='log2', min_samples_leaf=3,\n", 980 | " min_samples_split=3)" 981 | ] 982 | }, 983 | "execution_count": 22, 984 | "metadata": {}, 985 | "output_type": "execute_result" 986 | } 987 | ], 988 | "source": [ 989 | "best_grid" 990 | ] 991 | }, 992 | { 993 | "cell_type": "code", 994 | "execution_count": 23, 995 | "metadata": {}, 996 | "outputs": [ 997 | { 998 | "name": "stdout", 999 | "output_type": "stream", 1000 | "text": [ 1001 | "[[94 13]\n", 1002 | " [15 32]]\n", 1003 | "Accuracy Score 0.8181818181818182\n", 1004 | "Classification report: precision recall f1-score support\n", 1005 | "\n", 1006 | " 0 0.86 0.88 0.87 107\n", 1007 | " 1 0.71 0.68 0.70 47\n", 1008 | "\n", 1009 | " accuracy 0.82 154\n", 1010 | " macro avg 0.79 0.78 0.78 154\n", 1011 | "weighted avg 0.82 0.82 0.82 154\n", 1012 | "\n" 1013 | ] 1014 | } 1015 | ], 1016 | "source": [ 1017 | "y_pred=best_grid.predict(X_test)\n", 1018 | "print(confusion_matrix(y_test,y_pred))\n", 1019 | "print(\"Accuracy Score {}\".format(accuracy_score(y_test,y_pred)))\n", 1020 | "print(\"Classification report: {}\".format(classification_report(y_test,y_pred)))" 1021 | ] 1022 | }, 1023 | { 1024 | "cell_type": "markdown", 1025 | "metadata": {}, 1026 | "source": [ 1027 | "### Automated Hyperparameter Tuning\n", 1028 | "Automated Hyperparameter Tuning can be done by using techniques such as \n", 1029 | "- Bayesian Optimization\n", 1030 | "- Gradient Descent\n", 1031 | "- Evolutionary Algorithms" 1032 | ] 1033 | }, 1034 | { 1035 | "cell_type": "markdown", 1036 | "metadata": {}, 1037 | "source": [ 1038 | "#### Bayesian Optimization\n", 1039 | "Bayesian optimization uses probability to find the minimum of a function. The final aim is to find the input value to a function which can gives us the lowest possible output value.It usually performs better than random,grid and manual search providing better performance in the testing phase and reduced optimization time.\n", 1040 | "In Hyperopt, Bayesian Optimization can be implemented giving 3 three main parameters to the function fmin.\n", 1041 | "\n", 1042 | "- Objective Function = defines the loss function to minimize.\n", 1043 | "- Domain Space = defines the range of input values to test (in Bayesian Optimization this space creates a probability distribution for each of the used Hyperparameters).\n", 1044 | "- Optimization Algorithm = defines the search algorithm to use to select the best input values to use in each new iteration." 1045 | ] 1046 | }, 1047 | { 1048 | "cell_type": "code", 1049 | "execution_count": 25, 1050 | "metadata": {}, 1051 | "outputs": [], 1052 | "source": [ 1053 | "from hyperopt import hp,fmin,tpe,STATUS_OK,Trials" 1054 | ] 1055 | }, 1056 | { 1057 | "cell_type": "code", 1058 | "execution_count": 26, 1059 | "metadata": {}, 1060 | "outputs": [], 1061 | "source": [ 1062 | "space = {'criterion': hp.choice('criterion', ['entropy', 'gini']),\n", 1063 | " 'max_depth': hp.quniform('max_depth', 10, 1200, 10),\n", 1064 | " 'max_features': hp.choice('max_features', ['auto', 'sqrt','log2', None]),\n", 1065 | " 'min_samples_leaf': hp.uniform('min_samples_leaf', 0, 0.5),\n", 1066 | " 'min_samples_split' : hp.uniform ('min_samples_split', 0, 1),\n", 1067 | " 'n_estimators' : hp.choice('n_estimators', [10, 50, 300, 750, 1200,1300,1500])\n", 1068 | " }" 1069 | ] 1070 | }, 1071 | { 1072 | "cell_type": "code", 1073 | "execution_count": 27, 1074 | "metadata": {}, 1075 | "outputs": [ 1076 | { 1077 | "data": { 1078 | "text/plain": [ 1079 | "{'criterion': ,\n", 1080 | " 'max_depth': ,\n", 1081 | " 'max_features': ,\n", 1082 | " 'min_samples_leaf': ,\n", 1083 | " 'min_samples_split': ,\n", 1084 | " 'n_estimators': }" 1085 | ] 1086 | }, 1087 | "execution_count": 27, 1088 | "metadata": {}, 1089 | "output_type": "execute_result" 1090 | } 1091 | ], 1092 | "source": [ 1093 | "space" 1094 | ] 1095 | }, 1096 | { 1097 | "cell_type": "code", 1098 | "execution_count": 28, 1099 | "metadata": {}, 1100 | "outputs": [], 1101 | "source": [ 1102 | "\n", 1103 | "def objective(space):\n", 1104 | " model = RandomForestClassifier(criterion = space['criterion'], max_depth = space['max_depth'],\n", 1105 | " max_features = space['max_features'],\n", 1106 | " min_samples_leaf = space['min_samples_leaf'],\n", 1107 | " min_samples_split = space['min_samples_split'],\n", 1108 | " n_estimators = space['n_estimators'], \n", 1109 | " )\n", 1110 | " \n", 1111 | " accuracy = cross_val_score(model, X_train, y_train, cv = 5).mean()\n", 1112 | "\n", 1113 | " # We aim to maximize accuracy, therefore we return it as a negative value\n", 1114 | " return {'loss': -accuracy, 'status': STATUS_OK }" 1115 | ] 1116 | }, 1117 | { 1118 | "cell_type": "code", 1119 | "execution_count": 31, 1120 | "metadata": {}, 1121 | "outputs": [ 1122 | { 1123 | "name": "stdout", 1124 | "output_type": "stream", 1125 | "text": [ 1126 | "100%|███████████████████████████████████████████████| 80/80 [05:51<00:00, 4.39s/trial, best loss: -0.7687591630014661]\n" 1127 | ] 1128 | }, 1129 | { 1130 | "data": { 1131 | "text/plain": [ 1132 | "{'criterion': 1,\n", 1133 | " 'max_depth': 1110.0,\n", 1134 | " 'max_features': 1,\n", 1135 | " 'min_samples_leaf': 0.015761897600901124,\n", 1136 | " 'min_samples_split': 0.12204527235107072,\n", 1137 | " 'n_estimators': 3}" 1138 | ] 1139 | }, 1140 | "execution_count": 31, 1141 | "metadata": {}, 1142 | "output_type": "execute_result" 1143 | } 1144 | ], 1145 | "source": [ 1146 | "from sklearn.model_selection import cross_val_score\n", 1147 | "trials = Trials()\n", 1148 | "best = fmin(fn= objective,\n", 1149 | " space= space,\n", 1150 | " algo= tpe.suggest,\n", 1151 | " max_evals = 80,\n", 1152 | " trials= trials)\n", 1153 | "best" 1154 | ] 1155 | }, 1156 | { 1157 | "cell_type": "code", 1158 | "execution_count": 32, 1159 | "metadata": {}, 1160 | "outputs": [ 1161 | { 1162 | "name": "stdout", 1163 | "output_type": "stream", 1164 | "text": [ 1165 | "gini\n", 1166 | "sqrt\n", 1167 | "750\n" 1168 | ] 1169 | } 1170 | ], 1171 | "source": [ 1172 | "crit = {0: 'entropy', 1: 'gini'}\n", 1173 | "feat = {0: 'auto', 1: 'sqrt', 2: 'log2', 3: None}\n", 1174 | "est = {0: 10, 1: 50, 2: 300, 3: 750, 4: 1200,5:1300,6:1500}\n", 1175 | "\n", 1176 | "\n", 1177 | "print(crit[best['criterion']])\n", 1178 | "print(feat[best['max_features']])\n", 1179 | "print(est[best['n_estimators']])" 1180 | ] 1181 | }, 1182 | { 1183 | "cell_type": "code", 1184 | "execution_count": 33, 1185 | "metadata": {}, 1186 | "outputs": [ 1187 | { 1188 | "data": { 1189 | "text/plain": [ 1190 | "0.015761897600901124" 1191 | ] 1192 | }, 1193 | "execution_count": 33, 1194 | "metadata": {}, 1195 | "output_type": "execute_result" 1196 | } 1197 | ], 1198 | "source": [ 1199 | "best['min_samples_leaf']" 1200 | ] 1201 | }, 1202 | { 1203 | "cell_type": "code", 1204 | "execution_count": 34, 1205 | "metadata": {}, 1206 | "outputs": [ 1207 | { 1208 | "name": "stdout", 1209 | "output_type": "stream", 1210 | "text": [ 1211 | "[[98 9]\n", 1212 | " [22 25]]\n", 1213 | "0.7987012987012987\n", 1214 | " precision recall f1-score support\n", 1215 | "\n", 1216 | " 0 0.82 0.92 0.86 107\n", 1217 | " 1 0.74 0.53 0.62 47\n", 1218 | "\n", 1219 | " accuracy 0.80 154\n", 1220 | " macro avg 0.78 0.72 0.74 154\n", 1221 | "weighted avg 0.79 0.80 0.79 154\n", 1222 | "\n" 1223 | ] 1224 | } 1225 | ], 1226 | "source": [ 1227 | "trainedforest = RandomForestClassifier(criterion = crit[best['criterion']], max_depth = best['max_depth'], \n", 1228 | " max_features = feat[best['max_features']], \n", 1229 | " min_samples_leaf = best['min_samples_leaf'], \n", 1230 | " min_samples_split = best['min_samples_split'], \n", 1231 | " n_estimators = est[best['n_estimators']]).fit(X_train,y_train)\n", 1232 | "predictionforest = trainedforest.predict(X_test)\n", 1233 | "print(confusion_matrix(y_test,predictionforest))\n", 1234 | "print(accuracy_score(y_test,predictionforest))\n", 1235 | "print(classification_report(y_test,predictionforest))\n", 1236 | "acc5 = accuracy_score(y_test,predictionforest)" 1237 | ] 1238 | }, 1239 | { 1240 | "cell_type": "markdown", 1241 | "metadata": {}, 1242 | "source": [ 1243 | "#### Genetic Algorithms\n", 1244 | "Genetic Algorithms tries to apply natural selection mechanisms to Machine Learning contexts.\n", 1245 | "\n", 1246 | "Let's immagine we create a population of N Machine Learning models with some predifined Hyperparameters. We can then calculate the accuracy of each model and decide to keep just half of the models (the ones that performs best). We can now generate some offsprings having similar Hyperparameters to the ones of the best models so that go get again a population of N models. At this point we can again caltulate the accuracy of each model and repeate the cycle for a defined number of generations. In this way, just the best models will survive at the end of the process." 1247 | ] 1248 | }, 1249 | { 1250 | "cell_type": "code", 1251 | "execution_count": 35, 1252 | "metadata": {}, 1253 | "outputs": [ 1254 | { 1255 | "name": "stdout", 1256 | "output_type": "stream", 1257 | "text": [ 1258 | "{'n_estimators': [200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000], 'max_features': ['auto', 'sqrt', 'log2'], 'max_depth': [10, 120, 230, 340, 450, 560, 670, 780, 890, 1000], 'min_samples_split': [2, 5, 10, 14], 'min_samples_leaf': [1, 2, 4, 6, 8], 'criterion': ['entropy', 'gini']}\n" 1259 | ] 1260 | } 1261 | ], 1262 | "source": [ 1263 | "import numpy as np\n", 1264 | "from sklearn.model_selection import RandomizedSearchCV\n", 1265 | "# Number of trees in random forest\n", 1266 | "n_estimators = [int(x) for x in np.linspace(start = 200, stop = 2000, num = 10)]\n", 1267 | "# Number of features to consider at every split\n", 1268 | "max_features = ['auto', 'sqrt','log2']\n", 1269 | "# Maximum number of levels in tree\n", 1270 | "max_depth = [int(x) for x in np.linspace(10, 1000,10)]\n", 1271 | "# Minimum number of samples required to split a node\n", 1272 | "min_samples_split = [2, 5, 10,14]\n", 1273 | "# Minimum number of samples required at each leaf node\n", 1274 | "min_samples_leaf = [1, 2, 4,6,8]\n", 1275 | "# Create the random grid\n", 1276 | "param = {'n_estimators': n_estimators,\n", 1277 | " 'max_features': max_features,\n", 1278 | " 'max_depth': max_depth,\n", 1279 | " 'min_samples_split': min_samples_split,\n", 1280 | " 'min_samples_leaf': min_samples_leaf,\n", 1281 | " 'criterion':['entropy','gini']}\n", 1282 | "print(param)" 1283 | ] 1284 | }, 1285 | { 1286 | "cell_type": "code", 1287 | "execution_count": 39, 1288 | "metadata": {}, 1289 | "outputs": [ 1290 | { 1291 | "data": { 1292 | "application/vnd.jupyter.widget-view+json": { 1293 | "model_id": "", 1294 | "version_major": 2, 1295 | "version_minor": 0 1296 | }, 1297 | "text/plain": [ 1298 | "HBox(children=(FloatProgress(value=0.0, description='Optimization Progress', max=84.0, style=ProgressStyle(des…" 1299 | ] 1300 | }, 1301 | "metadata": {}, 1302 | "output_type": "display_data" 1303 | }, 1304 | { 1305 | "name": "stdout", 1306 | "output_type": "stream", 1307 | "text": [ 1308 | "\n", 1309 | "Generation 1 - Current best internal CV score: 0.7622442916560563\n", 1310 | "Generation 2 - Current best internal CV score: 0.7622442916560563\n", 1311 | "Generation 3 - Current best internal CV score: 0.7622442916560563" 1312 | ] 1313 | }, 1314 | { 1315 | "name": "stderr", 1316 | "output_type": "stream", 1317 | "text": [ 1318 | "Exception ignored in: ._remove at 0x00000247469D40D8>\n", 1319 | "Traceback (most recent call last):\n", 1320 | " File \"c:\\users\\krish naik\\anaconda3\\envs\\myenv1\\lib\\_weakrefset.py\", line 38, in _remove\n", 1321 | " def _remove(item, selfref=ref(self)):\n", 1322 | "stopit.utils.TimeoutException\n" 1323 | ] 1324 | }, 1325 | { 1326 | "name": "stdout", 1327 | "output_type": "stream", 1328 | "text": [ 1329 | "\n", 1330 | "Generation 4 - Current best internal CV score: 0.7622442916560563\n", 1331 | "Generation 5 - Current best internal CV score: 0.7622442916560563\n", 1332 | "Best pipeline: RandomForestClassifier(input_matrix, criterion=gini, max_depth=120, max_features=log2, min_samples_leaf=1, min_samples_split=2, n_estimators=200)\n" 1333 | ] 1334 | }, 1335 | { 1336 | "data": { 1337 | "text/plain": [ 1338 | "TPOTClassifier(config_dict={'sklearn.ensemble.RandomForestClassifier': {'criterion': ['entropy',\n", 1339 | " 'gini'],\n", 1340 | " 'max_depth': [10,\n", 1341 | " 120,\n", 1342 | " 230,\n", 1343 | " 340,\n", 1344 | " 450,\n", 1345 | " 560,\n", 1346 | " 670,\n", 1347 | " 780,\n", 1348 | " 890,\n", 1349 | " 1000],\n", 1350 | " 'max_features': ['auto',\n", 1351 | " 'sqrt',\n", 1352 | " 'log2'],\n", 1353 | " 'min_samples_leaf': [1,\n", 1354 | " 2,\n", 1355 | " 4,\n", 1356 | " 6,\n", 1357 | " 8],\n", 1358 | " 'min_samples_split': [2,\n", 1359 | " 5,\n", 1360 | " 10,\n", 1361 | " 14],\n", 1362 | " 'n_estimators': [200,\n", 1363 | " 400,\n", 1364 | " 600,\n", 1365 | " 800,\n", 1366 | " 1000,\n", 1367 | " 1200,\n", 1368 | " 1400,\n", 1369 | " 1600,\n", 1370 | " 1800,\n", 1371 | " 2000]}},\n", 1372 | " cv=4, early_stop=12, generations=5,\n", 1373 | " log_file=,\n", 1374 | " offspring_size=12, population_size=24, scoring='accuracy',\n", 1375 | " verbosity=2)" 1376 | ] 1377 | }, 1378 | "execution_count": 39, 1379 | "metadata": {}, 1380 | "output_type": "execute_result" 1381 | } 1382 | ], 1383 | "source": [ 1384 | "\n", 1385 | "from tpot import TPOTClassifier\n", 1386 | "\n", 1387 | "\n", 1388 | "tpot_classifier = TPOTClassifier(generations= 5, population_size= 24, offspring_size= 12,\n", 1389 | " verbosity= 2, early_stop= 12,\n", 1390 | " config_dict={'sklearn.ensemble.RandomForestClassifier': param}, \n", 1391 | " cv = 4, scoring = 'accuracy')\n", 1392 | "tpot_classifier.fit(X_train,y_train)" 1393 | ] 1394 | }, 1395 | { 1396 | "cell_type": "code", 1397 | "execution_count": 40, 1398 | "metadata": {}, 1399 | "outputs": [ 1400 | { 1401 | "name": "stdout", 1402 | "output_type": "stream", 1403 | "text": [ 1404 | "0.8181818181818182\n" 1405 | ] 1406 | } 1407 | ], 1408 | "source": [ 1409 | "\n", 1410 | "accuracy = tpot_classifier.score(X_test, y_test)\n", 1411 | "print(accuracy)" 1412 | ] 1413 | }, 1414 | { 1415 | "cell_type": "markdown", 1416 | "metadata": {}, 1417 | "source": [ 1418 | "### Optimize hyperparameters of the model using Optuna\n", 1419 | "\n", 1420 | "The hyperparameters of the above algorithm are `n_estimators` and `max_depth` for which we can try different values to see if the model accuracy can be improved. The `objective` function is modified to accept a trial object. This trial has several methods for sampling hyperparameters. We create a study to run the hyperparameter optimization and finally read the best hyperparameters." 1421 | ] 1422 | }, 1423 | { 1424 | "cell_type": "code", 1425 | "execution_count": 49, 1426 | "metadata": {}, 1427 | "outputs": [], 1428 | "source": [ 1429 | "import optuna\n", 1430 | "import sklearn.svm\n", 1431 | "def objective(trial):\n", 1432 | "\n", 1433 | " classifier = trial.suggest_categorical('classifier', ['RandomForest', 'SVC'])\n", 1434 | " \n", 1435 | " if classifier == 'RandomForest':\n", 1436 | " n_estimators = trial.suggest_int('n_estimators', 200, 2000,10)\n", 1437 | " max_depth = int(trial.suggest_float('max_depth', 10, 100, log=True))\n", 1438 | "\n", 1439 | " clf = sklearn.ensemble.RandomForestClassifier(\n", 1440 | " n_estimators=n_estimators, max_depth=max_depth)\n", 1441 | " else:\n", 1442 | " c = trial.suggest_float('svc_c', 1e-10, 1e10, log=True)\n", 1443 | " \n", 1444 | " clf = sklearn.svm.SVC(C=c, gamma='auto')\n", 1445 | "\n", 1446 | " return sklearn.model_selection.cross_val_score(\n", 1447 | " clf,X_train,y_train, n_jobs=-1, cv=3).mean()\n" 1448 | ] 1449 | }, 1450 | { 1451 | "cell_type": "code", 1452 | "execution_count": 50, 1453 | "metadata": {}, 1454 | "outputs": [ 1455 | { 1456 | "name": "stderr", 1457 | "output_type": "stream", 1458 | "text": [ 1459 | "[I 2020-07-22 17:29:25,669] Finished trial#0 with value: 0.7459190180137095 with parameters: {'classifier': 'RandomForest', 'n_estimators': 560, 'max_depth': 45.428344785672444}. Best is trial#0 with value: 0.7459190180137095.\n", 1460 | "[I 2020-07-22 17:29:25,762] Finished trial#1 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 382014186.2292944}. Best is trial#0 with value: 0.7459190180137095.\n", 1461 | "[I 2020-07-22 17:29:27,152] Finished trial#2 with value: 0.7524469950581859 with parameters: {'classifier': 'RandomForest', 'n_estimators': 990, 'max_depth': 42.25927339838532}. Best is trial#2 with value: 0.7524469950581859.\n", 1462 | "[I 2020-07-22 17:29:29,066] Finished trial#3 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1420, 'max_depth': 27.841871988819953}. Best is trial#2 with value: 0.7524469950581859.\n", 1463 | "[I 2020-07-22 17:29:31,190] Finished trial#4 with value: 0.7475530049418141 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1560, 'max_depth': 33.82604471162079}. Best is trial#2 with value: 0.7524469950581859.\n", 1464 | "[I 2020-07-22 17:29:32,336] Finished trial#5 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 810, 'max_depth': 38.563300841598476}. Best is trial#2 with value: 0.7524469950581859.\n", 1465 | "[I 2020-07-22 17:29:32,430] Finished trial#6 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 116.01096494017403}. Best is trial#2 with value: 0.7524469950581859.\n", 1466 | "[I 2020-07-22 17:29:32,517] Finished trial#7 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 2.298825620064036e-06}. Best is trial#2 with value: 0.7524469950581859.\n", 1467 | "[I 2020-07-22 17:29:33,893] Finished trial#8 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 970, 'max_depth': 64.15168265175629}. Best is trial#2 with value: 0.7524469950581859.\n", 1468 | "[I 2020-07-22 17:29:34,722] Finished trial#9 with value: 0.744293001753547 with parameters: {'classifier': 'RandomForest', 'n_estimators': 570, 'max_depth': 12.111594105838392}. Best is trial#2 with value: 0.7524469950581859.\n", 1469 | "[I 2020-07-22 17:29:37,410] Finished trial#10 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1950, 'max_depth': 96.32160637795971}. Best is trial#2 with value: 0.7524469950581859.\n", 1470 | "[I 2020-07-22 17:29:39,428] Finished trial#11 with value: 0.7524390243902439 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1390, 'max_depth': 16.866832427669866}. Best is trial#2 with value: 0.7524469950581859.\n", 1471 | "[I 2020-07-22 17:29:41,263] Finished trial#12 with value: 0.7524390243902439 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1330, 'max_depth': 17.353138766268824}. Best is trial#2 with value: 0.7524469950581859.\n", 1472 | "[I 2020-07-22 17:29:43,778] Finished trial#13 with value: 0.75242308305436 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1830, 'max_depth': 18.976699590496274}. Best is trial#2 with value: 0.7524469950581859.\n", 1473 | "[I 2020-07-22 17:29:44,157] Finished trial#14 with value: 0.7475370636059302 with parameters: {'classifier': 'RandomForest', 'n_estimators': 210, 'max_depth': 10.277581734452633}. Best is trial#2 with value: 0.7524469950581859.\n", 1474 | "[I 2020-07-22 17:29:45,900] Finished trial#15 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1140, 'max_depth': 22.11789321936667}. Best is trial#2 with value: 0.7524469950581859.\n", 1475 | "[I 2020-07-22 17:29:48,257] Finished trial#16 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1640, 'max_depth': 61.24717197044995}. Best is trial#2 with value: 0.7524469950581859.\n", 1476 | "[I 2020-07-22 17:29:48,343] Finished trial#17 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 1.0373068843430439e-10}. Best is trial#2 with value: 0.7524469950581859.\n", 1477 | "[I 2020-07-22 17:29:50,028] Finished trial#18 with value: 0.7475609756097561 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1170, 'max_depth': 13.58624517625075}. Best is trial#2 with value: 0.7524469950581859.\n", 1478 | "[I 2020-07-22 17:29:51,169] Finished trial#19 with value: 0.7556830862426271 with parameters: {'classifier': 'RandomForest', 'n_estimators': 810, 'max_depth': 26.06992262577861}. Best is trial#19 with value: 0.7556830862426271.\n", 1479 | "[I 2020-07-22 17:29:51,264] Finished trial#20 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 593045673.4121734}. Best is trial#19 with value: 0.7556830862426271.\n", 1480 | "[I 2020-07-22 17:29:52,470] Finished trial#21 with value: 0.7475530049418141 with parameters: {'classifier': 'RandomForest', 'n_estimators': 800, 'max_depth': 26.193898724637403}. Best is trial#19 with value: 0.7556830862426271.\n", 1481 | "[I 2020-07-22 17:29:53,978] Finished trial#22 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1010, 'max_depth': 43.24161116653229}. Best is trial#19 with value: 0.7556830862426271.\n", 1482 | "[I 2020-07-22 17:29:55,053] Finished trial#23 with value: 0.7573091025027897 with parameters: {'classifier': 'RandomForest', 'n_estimators': 750, 'max_depth': 16.51585932349767}. Best is trial#23 with value: 0.7573091025027897.\n", 1483 | "[I 2020-07-22 17:29:55,854] Finished trial#24 with value: 0.744293001753547 with parameters: {'classifier': 'RandomForest', 'n_estimators': 480, 'max_depth': 23.534083036669067}. Best is trial#23 with value: 0.7573091025027897.\n", 1484 | "[I 2020-07-22 17:29:57,030] Finished trial#25 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 770, 'max_depth': 54.286060191398654}. Best is trial#23 with value: 0.7573091025027897.\n", 1485 | "[I 2020-07-22 17:29:57,602] Finished trial#26 with value: 0.7589430894308943 with parameters: {'classifier': 'RandomForest', 'n_estimators': 330, 'max_depth': 30.02830174010586}. Best is trial#26 with value: 0.7589430894308943.\n", 1486 | "[I 2020-07-22 17:29:58,082] Finished trial#27 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 270, 'max_depth': 31.618595560356702}. Best is trial#26 with value: 0.7589430894308943.\n", 1487 | "[I 2020-07-22 17:29:58,703] Finished trial#28 with value: 0.7508130081300813 with parameters: {'classifier': 'RandomForest', 'n_estimators': 370, 'max_depth': 13.897987597367557}. Best is trial#26 with value: 0.7589430894308943.\n", 1488 | "[I 2020-07-22 17:29:59,728] Finished trial#29 with value: 0.7524390243902439 with parameters: {'classifier': 'RandomForest', 'n_estimators': 710, 'max_depth': 20.944711220128674}. Best is trial#26 with value: 0.7589430894308943.\n", 1489 | "[I 2020-07-22 17:30:00,368] Finished trial#30 with value: 0.7507890961262554 with parameters: {'classifier': 'RandomForest', 'n_estimators': 420, 'max_depth': 30.469391836696254}. Best is trial#26 with value: 0.7589430894308943.\n", 1490 | "[I 2020-07-22 17:30:01,825] Finished trial#31 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 960, 'max_depth': 38.31448830764323}. Best is trial#26 with value: 0.7589430894308943.\n", 1491 | "[I 2020-07-22 17:30:02,848] Finished trial#32 with value: 0.7540730113183485 with parameters: {'classifier': 'RandomForest', 'n_estimators': 650, 'max_depth': 50.49579891136223}. Best is trial#26 with value: 0.7589430894308943.\n", 1492 | "[I 2020-07-22 17:30:03,985] Finished trial#33 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 680, 'max_depth': 71.81402577531695}. Best is trial#26 with value: 0.7589430894308943.\n", 1493 | "[I 2020-07-22 17:30:04,513] Finished trial#34 with value: 0.7475450342738722 with parameters: {'classifier': 'RandomForest', 'n_estimators': 310, 'max_depth': 92.43030726955858}. Best is trial#26 with value: 0.7589430894308943.\n", 1494 | "[I 2020-07-22 17:30:05,437] Finished trial#35 with value: 0.7508050374621393 with parameters: {'classifier': 'RandomForest', 'n_estimators': 590, 'max_depth': 50.443426440902826}. Best is trial#26 with value: 0.7589430894308943.\n", 1495 | "[I 2020-07-22 17:30:06,207] Finished trial#36 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 510, 'max_depth': 27.075291591508652}. Best is trial#26 with value: 0.7589430894308943.\n", 1496 | "[I 2020-07-22 17:30:06,306] Finished trial#37 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 1.2993364331873203}. Best is trial#26 with value: 0.7589430894308943.\n", 1497 | "[I 2020-07-22 17:30:07,572] Finished trial#38 with value: 0.7426669854933844 with parameters: {'classifier': 'RandomForest', 'n_estimators': 850, 'max_depth': 15.598118080606088}. Best is trial#26 with value: 0.7589430894308943.\n", 1498 | "[I 2020-07-22 17:30:08,575] Finished trial#39 with value: 0.744285031085605 with parameters: {'classifier': 'RandomForest', 'n_estimators': 640, 'max_depth': 36.70667631325387}. Best is trial#26 with value: 0.7589430894308943.\n", 1499 | "[I 2020-07-22 17:30:09,951] Finished trial#40 with value: 0.7540570699824646 with parameters: {'classifier': 'RandomForest', 'n_estimators': 890, 'max_depth': 24.278885906819983}. Best is trial#26 with value: 0.7589430894308943.\n", 1500 | "[I 2020-07-22 17:30:11,302] Finished trial#41 with value: 0.7540730113183485 with parameters: {'classifier': 'RandomForest', 'n_estimators': 880, 'max_depth': 24.639493598039277}. Best is trial#26 with value: 0.7589430894308943.\n", 1501 | "[I 2020-07-22 17:30:12,378] Finished trial#42 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 710, 'max_depth': 30.152677615795024}. Best is trial#26 with value: 0.7589430894308943.\n", 1502 | "[I 2020-07-22 17:30:13,983] Finished trial#43 with value: 0.7491710505340348 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1090, 'max_depth': 21.299836366433247}. Best is trial#26 with value: 0.7589430894308943.\n", 1503 | "[I 2020-07-22 17:30:15,310] Finished trial#44 with value: 0.7507970667941973 with parameters: {'classifier': 'RandomForest', 'n_estimators': 900, 'max_depth': 33.72373163980857}. Best is trial#26 with value: 0.7589430894308943.\n", 1504 | "[I 2020-07-22 17:30:16,898] Finished trial#45 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1030, 'max_depth': 26.744319304545098}. Best is trial#26 with value: 0.7589430894308943.\n", 1505 | "[I 2020-07-22 17:30:16,984] Finished trial#46 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 1.765228116724797e-06}. Best is trial#26 with value: 0.7589430894308943.\n", 1506 | "[I 2020-07-22 17:30:18,743] Finished trial#47 with value: 0.7556830862426271 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1240, 'max_depth': 19.536814334499145}. Best is trial#26 with value: 0.7589430894308943.\n", 1507 | "[I 2020-07-22 17:30:20,625] Finished trial#48 with value: 0.7475450342738722 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1270, 'max_depth': 18.70415248965657}. Best is trial#26 with value: 0.7589430894308943.\n", 1508 | "[I 2020-07-22 17:30:22,754] Finished trial#49 with value: 0.7508050374621393 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1500, 'max_depth': 15.088392240941921}. Best is trial#26 with value: 0.7589430894308943.\n", 1509 | "[I 2020-07-22 17:30:23,593] Finished trial#50 with value: 0.7442690897497211 with parameters: {'classifier': 'RandomForest', 'n_estimators': 570, 'max_depth': 11.470531223921249}. Best is trial#26 with value: 0.7589430894308943.\n", 1510 | "[I 2020-07-22 17:30:25,426] Finished trial#51 with value: 0.7491869918699187 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1210, 'max_depth': 19.53214190067025}. Best is trial#26 with value: 0.7589430894308943.\n", 1511 | "[I 2020-07-22 17:30:26,628] Finished trial#52 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 770, 'max_depth': 24.177542200140888}. Best is trial#26 with value: 0.7589430894308943.\n", 1512 | "[I 2020-07-22 17:30:27,967] Finished trial#53 with value: 0.7491869918699187 with parameters: {'classifier': 'RandomForest', 'n_estimators': 930, 'max_depth': 17.205429365298503}. Best is trial#26 with value: 0.7589430894308943.\n", 1513 | "[I 2020-07-22 17:30:29,483] Finished trial#54 with value: 0.7459110473457676 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1070, 'max_depth': 28.22494087303447}. Best is trial#26 with value: 0.7589430894308943.\n", 1514 | "[I 2020-07-22 17:30:30,495] Finished trial#55 with value: 0.7475530049418141 with parameters: {'classifier': 'RandomForest', 'n_estimators': 640, 'max_depth': 20.18043999110511}. Best is trial#26 with value: 0.7589430894308943.\n", 1515 | "[I 2020-07-22 17:30:31,708] Finished trial#56 with value: 0.7491710505340348 with parameters: {'classifier': 'RandomForest', 'n_estimators': 840, 'max_depth': 22.593013535367504}. Best is trial#26 with value: 0.7589430894308943.\n", 1516 | "[I 2020-07-22 17:30:32,441] Finished trial#57 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 460, 'max_depth': 25.3463407169904}. Best is trial#26 with value: 0.7589430894308943.\n", 1517 | "[I 2020-07-22 17:30:32,532] Finished trial#58 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 30008.546064639668}. Best is trial#26 with value: 0.7589430894308943.\n", 1518 | "[I 2020-07-22 17:30:34,479] Finished trial#59 with value: 0.7475689462776981 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1350, 'max_depth': 35.18893159953987}. Best is trial#26 with value: 0.7589430894308943.\n", 1519 | "[I 2020-07-22 17:30:36,392] Finished trial#60 with value: 0.7459190180137095 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1250, 'max_depth': 17.52810759361537}. Best is trial#26 with value: 0.7589430894308943.\n", 1520 | "[I 2020-07-22 17:30:37,659] Finished trial#61 with value: 0.7459110473457676 with parameters: {'classifier': 'RandomForest', 'n_estimators': 850, 'max_depth': 23.693849001413888}. Best is trial#26 with value: 0.7589430894308943.\n", 1521 | "[I 2020-07-22 17:30:39,019] Finished trial#62 with value: 0.744285031085605 with parameters: {'classifier': 'RandomForest', 'n_estimators': 890, 'max_depth': 28.96587659841046}. Best is trial#26 with value: 0.7589430894308943.\n", 1522 | "[I 2020-07-22 17:30:40,141] Finished trial#63 with value: 0.7475530049418141 with parameters: {'classifier': 'RandomForest', 'n_estimators': 760, 'max_depth': 33.64843819822842}. Best is trial#26 with value: 0.7589430894308943.\n", 1523 | "[I 2020-07-22 17:30:41,520] Finished trial#64 with value: 0.7491630798660928 with parameters: {'classifier': 'RandomForest', 'n_estimators': 970, 'max_depth': 40.77312709628961}. Best is trial#26 with value: 0.7589430894308943.\n", 1524 | "[I 2020-07-22 17:30:43,161] Finished trial#65 with value: 0.7491710505340348 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1140, 'max_depth': 24.79718320377235}. Best is trial#26 with value: 0.7589430894308943.\n", 1525 | "[I 2020-07-22 17:30:44,686] Finished trial#66 with value: 0.7508130081300813 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1030, 'max_depth': 21.78892585293122}. Best is trial#26 with value: 0.7589430894308943.\n", 1526 | "[I 2020-07-22 17:30:45,809] Finished trial#67 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 730, 'max_depth': 15.981758086555269}. Best is trial#26 with value: 0.7589430894308943.\n", 1527 | "[I 2020-07-22 17:30:46,755] Finished trial#68 with value: 0.744285031085605 with parameters: {'classifier': 'RandomForest', 'n_estimators': 610, 'max_depth': 19.028172963488487}. Best is trial#26 with value: 0.7589430894308943.\n", 1528 | "[I 2020-07-22 17:30:47,595] Finished trial#69 with value: 0.75242308305436 with parameters: {'classifier': 'RandomForest', 'n_estimators': 520, 'max_depth': 13.767850596533478}. Best is trial#26 with value: 0.7589430894308943.\n", 1529 | "[I 2020-07-22 17:30:48,866] Finished trial#70 with value: 0.7573091025027897 with parameters: {'classifier': 'RandomForest', 'n_estimators': 820, 'max_depth': 74.47439206198088}. Best is trial#26 with value: 0.7589430894308943.\n", 1530 | "[I 2020-07-22 17:30:49,222] Finished trial#71 with value: 0.75242308305436 with parameters: {'classifier': 'RandomForest', 'n_estimators': 210, 'max_depth': 72.17451911098534}. Best is trial#26 with value: 0.7589430894308943.\n" 1531 | ] 1532 | }, 1533 | { 1534 | "name": "stderr", 1535 | "output_type": "stream", 1536 | "text": [ 1537 | "[I 2020-07-22 17:30:50,541] Finished trial#72 with value: 0.7394069823051171 with parameters: {'classifier': 'RandomForest', 'n_estimators': 800, 'max_depth': 99.75099049302369}. Best is trial#26 with value: 0.7589430894308943.\n", 1538 | "[I 2020-07-22 17:30:51,537] Finished trial#73 with value: 0.7475530049418141 with parameters: {'classifier': 'RandomForest', 'n_estimators': 670, 'max_depth': 80.40293451897855}. Best is trial#26 with value: 0.7589430894308943.\n", 1539 | "[I 2020-07-22 17:30:52,840] Finished trial#74 with value: 0.7540650406504065 with parameters: {'classifier': 'RandomForest', 'n_estimators': 880, 'max_depth': 47.21541760312192}. Best is trial#26 with value: 0.7589430894308943.\n", 1540 | "[I 2020-07-22 17:30:53,422] Finished trial#75 with value: 0.7508050374621393 with parameters: {'classifier': 'RandomForest', 'n_estimators': 370, 'max_depth': 55.41043514073563}. Best is trial#26 with value: 0.7589430894308943.\n", 1541 | "[I 2020-07-22 17:30:54,876] Finished trial#76 with value: 0.7556830862426271 with parameters: {'classifier': 'RandomForest', 'n_estimators': 990, 'max_depth': 45.56806623020355}. Best is trial#26 with value: 0.7589430894308943.\n", 1542 | "[I 2020-07-22 17:30:56,228] Finished trial#77 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 970, 'max_depth': 61.005802364636914}. Best is trial#26 with value: 0.7589430894308943.\n", 1543 | "[I 2020-07-22 17:30:56,316] Finished trial#78 with value: 0.640068547744301 with parameters: {'classifier': 'SVC', 'svc_c': 7.647818733220187e-06}. Best is trial#26 with value: 0.7589430894308943.\n", 1544 | "[I 2020-07-22 17:30:57,904] Finished trial#79 with value: 0.7524310537223019 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1140, 'max_depth': 87.23026678309658}. Best is trial#26 with value: 0.7589430894308943.\n", 1545 | "[I 2020-07-22 17:30:59,443] Finished trial#80 with value: 0.7508050374621393 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1070, 'max_depth': 43.57895946385289}. Best is trial#26 with value: 0.7589430894308943.\n", 1546 | "[I 2020-07-22 17:31:00,709] Finished trial#81 with value: 0.7491710505340348 with parameters: {'classifier': 'RandomForest', 'n_estimators': 830, 'max_depth': 51.44475515363362}. Best is trial#26 with value: 0.7589430894308943.\n", 1547 | "[I 2020-07-22 17:31:02,093] Finished trial#82 with value: 0.7459190180137095 with parameters: {'classifier': 'RandomForest', 'n_estimators': 930, 'max_depth': 47.043165242503896}. Best is trial#26 with value: 0.7589430894308943.\n", 1548 | "[I 2020-07-22 17:31:03,127] Finished trial#83 with value: 0.7524390243902439 with parameters: {'classifier': 'RandomForest', 'n_estimators': 710, 'max_depth': 47.81405467708041}. Best is trial#26 with value: 0.7589430894308943.\n", 1549 | "[I 2020-07-22 17:31:04,534] Finished trial#84 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1020, 'max_depth': 40.07976389933971}. Best is trial#26 with value: 0.7589430894308943.\n", 1550 | "[I 2020-07-22 17:31:05,616] Finished trial#85 with value: 0.7475450342738722 with parameters: {'classifier': 'RandomForest', 'n_estimators': 780, 'max_depth': 32.00132869479938}. Best is trial#26 with value: 0.7589430894308943.\n", 1551 | "[I 2020-07-22 17:31:06,872] Finished trial#86 with value: 0.7589271480950104 with parameters: {'classifier': 'RandomForest', 'n_estimators': 880, 'max_depth': 57.62379085133717}. Best is trial#26 with value: 0.7589430894308943.\n", 1552 | "[I 2020-07-22 17:31:08,201] Finished trial#87 with value: 0.7475530049418141 with parameters: {'classifier': 'RandomForest', 'n_estimators': 930, 'max_depth': 69.51334259544966}. Best is trial#26 with value: 0.7589430894308943.\n", 1553 | "[I 2020-07-22 17:31:10,150] Finished trial#88 with value: 0.7556830862426271 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1420, 'max_depth': 58.21916890693221}. Best is trial#26 with value: 0.7589430894308943.\n", 1554 | "[I 2020-07-22 17:31:12,336] Finished trial#89 with value: 0.7540650406504065 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1650, 'max_depth': 58.6770907625422}. Best is trial#26 with value: 0.7589430894308943.\n", 1555 | "[I 2020-07-22 17:31:14,326] Finished trial#90 with value: 0.7540570699824646 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1420, 'max_depth': 67.41669489829536}. Best is trial#26 with value: 0.7589430894308943.\n", 1556 | "[I 2020-07-22 17:31:16,495] Finished trial#91 with value: 0.7459269886816515 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1510, 'max_depth': 55.40995368855331}. Best is trial#26 with value: 0.7589430894308943.\n", 1557 | "[I 2020-07-22 17:31:18,328] Finished trial#92 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1290, 'max_depth': 63.675677219798835}. Best is trial#26 with value: 0.7589430894308943.\n", 1558 | "[I 2020-07-22 17:31:20,247] Finished trial#93 with value: 0.744293001753547 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1450, 'max_depth': 57.787937579774855}. Best is trial#26 with value: 0.7589430894308943.\n", 1559 | "[I 2020-07-22 17:31:22,575] Finished trial#94 with value: 0.7475450342738722 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1640, 'max_depth': 77.339561935967}. Best is trial#26 with value: 0.7589430894308943.\n", 1560 | "[I 2020-07-22 17:31:24,248] Finished trial#95 with value: 0.7491790212019768 with parameters: {'classifier': 'RandomForest', 'n_estimators': 1210, 'max_depth': 51.30177472499095}. Best is trial#26 with value: 0.7589430894308943.\n", 1561 | "[I 2020-07-22 17:31:25,461] Finished trial#96 with value: 0.7508050374621393 with parameters: {'classifier': 'RandomForest', 'n_estimators': 860, 'max_depth': 64.87873839898693}. Best is trial#26 with value: 0.7589430894308943.\n", 1562 | "[I 2020-07-22 17:31:26,479] Finished trial#97 with value: 0.7491551091981509 with parameters: {'classifier': 'RandomForest', 'n_estimators': 740, 'max_depth': 26.263414444248404}. Best is trial#26 with value: 0.7589430894308943.\n", 1563 | "[I 2020-07-22 17:31:27,619] Finished trial#98 with value: 0.7540730113183485 with parameters: {'classifier': 'RandomForest', 'n_estimators': 810, 'max_depth': 36.90991074547584}. Best is trial#26 with value: 0.7589430894308943.\n", 1564 | "[I 2020-07-22 17:31:28,571] Finished trial#99 with value: 0.7491710505340348 with parameters: {'classifier': 'RandomForest', 'n_estimators': 670, 'max_depth': 37.0342538028874}. Best is trial#26 with value: 0.7589430894308943.\n" 1565 | ] 1566 | }, 1567 | { 1568 | "name": "stdout", 1569 | "output_type": "stream", 1570 | "text": [ 1571 | "Accuracy: 0.7589430894308943\n", 1572 | "Best hyperparameters: {'classifier': 'RandomForest', 'n_estimators': 330, 'max_depth': 30.02830174010586}\n" 1573 | ] 1574 | } 1575 | ], 1576 | "source": [ 1577 | "study = optuna.create_study(direction='maximize')\n", 1578 | "study.optimize(objective, n_trials=100)\n", 1579 | "\n", 1580 | "trial = study.best_trial\n", 1581 | "\n", 1582 | "print('Accuracy: {}'.format(trial.value))\n", 1583 | "print(\"Best hyperparameters: {}\".format(trial.params))" 1584 | ] 1585 | }, 1586 | { 1587 | "cell_type": "code", 1588 | "execution_count": 67, 1589 | "metadata": {}, 1590 | "outputs": [ 1591 | { 1592 | "data": { 1593 | "text/plain": [ 1594 | "FrozenTrial(number=26, value=0.7589430894308943, datetime_start=datetime.datetime(2020, 7, 22, 17, 29, 57, 32020), datetime_complete=datetime.datetime(2020, 7, 22, 17, 29, 57, 602495), params={'classifier': 'RandomForest', 'n_estimators': 330, 'max_depth': 30.02830174010586}, distributions={'classifier': CategoricalDistribution(choices=('RandomForest', 'SVC')), 'n_estimators': IntUniformDistribution(high=2000, low=200, step=10), 'max_depth': LogUniformDistribution(high=100, low=10)}, user_attrs={}, system_attrs={}, intermediate_values={}, trial_id=26, state=TrialState.COMPLETE)" 1595 | ] 1596 | }, 1597 | "execution_count": 67, 1598 | "metadata": {}, 1599 | "output_type": "execute_result" 1600 | } 1601 | ], 1602 | "source": [ 1603 | "trial" 1604 | ] 1605 | }, 1606 | { 1607 | "cell_type": "code", 1608 | "execution_count": 71, 1609 | "metadata": {}, 1610 | "outputs": [ 1611 | { 1612 | "data": { 1613 | "text/plain": [ 1614 | "{'classifier': 'RandomForest',\n", 1615 | " 'n_estimators': 330,\n", 1616 | " 'max_depth': 30.02830174010586}" 1617 | ] 1618 | }, 1619 | "execution_count": 71, 1620 | "metadata": {}, 1621 | "output_type": "execute_result" 1622 | } 1623 | ], 1624 | "source": [ 1625 | "study.best_params" 1626 | ] 1627 | }, 1628 | { 1629 | "cell_type": "code", 1630 | "execution_count": 76, 1631 | "metadata": {}, 1632 | "outputs": [ 1633 | { 1634 | "data": { 1635 | "text/plain": [ 1636 | "RandomForestClassifier(max_depth=30, n_estimators=330)" 1637 | ] 1638 | }, 1639 | "execution_count": 76, 1640 | "metadata": {}, 1641 | "output_type": "execute_result" 1642 | } 1643 | ], 1644 | "source": [ 1645 | "rf=RandomForestClassifier(n_estimators=330,max_depth=30)\n", 1646 | "rf.fit(X_train,y_train)" 1647 | ] 1648 | }, 1649 | { 1650 | "cell_type": "code", 1651 | "execution_count": 77, 1652 | "metadata": {}, 1653 | "outputs": [ 1654 | { 1655 | "name": "stdout", 1656 | "output_type": "stream", 1657 | "text": [ 1658 | "[[94 13]\n", 1659 | " [14 33]]\n", 1660 | "0.8246753246753247\n", 1661 | " precision recall f1-score support\n", 1662 | "\n", 1663 | " 0 0.87 0.88 0.87 107\n", 1664 | " 1 0.72 0.70 0.71 47\n", 1665 | "\n", 1666 | " accuracy 0.82 154\n", 1667 | " macro avg 0.79 0.79 0.79 154\n", 1668 | "weighted avg 0.82 0.82 0.82 154\n", 1669 | "\n" 1670 | ] 1671 | } 1672 | ], 1673 | "source": [ 1674 | "y_pred=rf.predict(X_test)\n", 1675 | "print(confusion_matrix(y_test,y_pred))\n", 1676 | "print(accuracy_score(y_test,y_pred))\n", 1677 | "print(classification_report(y_test,y_pred))" 1678 | ] 1679 | }, 1680 | { 1681 | "cell_type": "code", 1682 | "execution_count": null, 1683 | "metadata": {}, 1684 | "outputs": [], 1685 | "source": [] 1686 | } 1687 | ], 1688 | "metadata": { 1689 | "kernelspec": { 1690 | "display_name": "Python 3", 1691 | "language": "python", 1692 | "name": "python3" 1693 | }, 1694 | "language_info": { 1695 | "codemirror_mode": { 1696 | "name": "ipython", 1697 | "version": 3 1698 | }, 1699 | "file_extension": ".py", 1700 | "mimetype": "text/x-python", 1701 | "name": "python", 1702 | "nbconvert_exporter": "python", 1703 | "pygments_lexer": "ipython3", 1704 | "version": "3.7.7" 1705 | } 1706 | }, 1707 | "nbformat": 4, 1708 | "nbformat_minor": 4 1709 | } 1710 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # All-Hyperparamter-Optimization -------------------------------------------------------------------------------- /diabetes.csv: -------------------------------------------------------------------------------- 1 | Pregnancies,Glucose,BloodPressure,SkinThickness,Insulin,BMI,DiabetesPedigreeFunction,Age,Outcome 2 | 6,148,72,35,0,33.6,0.627,50,1 3 | 1,85,66,29,0,26.6,0.351,31,0 4 | 8,183,64,0,0,23.3,0.672,32,1 5 | 1,89,66,23,94,28.1,0.167,21,0 6 | 0,137,40,35,168,43.1,2.288,33,1 7 | 5,116,74,0,0,25.6,0.201,30,0 8 | 3,78,50,32,88,31,0.248,26,1 9 | 10,115,0,0,0,35.3,0.134,29,0 10 | 2,197,70,45,543,30.5,0.158,53,1 11 | 8,125,96,0,0,0,0.232,54,1 12 | 4,110,92,0,0,37.6,0.191,30,0 13 | 10,168,74,0,0,38,0.537,34,1 14 | 10,139,80,0,0,27.1,1.441,57,0 15 | 1,189,60,23,846,30.1,0.398,59,1 16 | 5,166,72,19,175,25.8,0.587,51,1 17 | 7,100,0,0,0,30,0.484,32,1 18 | 0,118,84,47,230,45.8,0.551,31,1 19 | 7,107,74,0,0,29.6,0.254,31,1 20 | 1,103,30,38,83,43.3,0.183,33,0 21 | 1,115,70,30,96,34.6,0.529,32,1 22 | 3,126,88,41,235,39.3,0.704,27,0 23 | 8,99,84,0,0,35.4,0.388,50,0 24 | 7,196,90,0,0,39.8,0.451,41,1 25 | 9,119,80,35,0,29,0.263,29,1 26 | 11,143,94,33,146,36.6,0.254,51,1 27 | 10,125,70,26,115,31.1,0.205,41,1 28 | 7,147,76,0,0,39.4,0.257,43,1 29 | 1,97,66,15,140,23.2,0.487,22,0 30 | 13,145,82,19,110,22.2,0.245,57,0 31 | 5,117,92,0,0,34.1,0.337,38,0 32 | 5,109,75,26,0,36,0.546,60,0 33 | 3,158,76,36,245,31.6,0.851,28,1 34 | 3,88,58,11,54,24.8,0.267,22,0 35 | 6,92,92,0,0,19.9,0.188,28,0 36 | 10,122,78,31,0,27.6,0.512,45,0 37 | 4,103,60,33,192,24,0.966,33,0 38 | 11,138,76,0,0,33.2,0.42,35,0 39 | 9,102,76,37,0,32.9,0.665,46,1 40 | 2,90,68,42,0,38.2,0.503,27,1 41 | 4,111,72,47,207,37.1,1.39,56,1 42 | 3,180,64,25,70,34,0.271,26,0 43 | 7,133,84,0,0,40.2,0.696,37,0 44 | 7,106,92,18,0,22.7,0.235,48,0 45 | 9,171,110,24,240,45.4,0.721,54,1 46 | 7,159,64,0,0,27.4,0.294,40,0 47 | 0,180,66,39,0,42,1.893,25,1 48 | 1,146,56,0,0,29.7,0.564,29,0 49 | 2,71,70,27,0,28,0.586,22,0 50 | 7,103,66,32,0,39.1,0.344,31,1 51 | 7,105,0,0,0,0,0.305,24,0 52 | 1,103,80,11,82,19.4,0.491,22,0 53 | 1,101,50,15,36,24.2,0.526,26,0 54 | 5,88,66,21,23,24.4,0.342,30,0 55 | 8,176,90,34,300,33.7,0.467,58,1 56 | 7,150,66,42,342,34.7,0.718,42,0 57 | 1,73,50,10,0,23,0.248,21,0 58 | 7,187,68,39,304,37.7,0.254,41,1 59 | 0,100,88,60,110,46.8,0.962,31,0 60 | 0,146,82,0,0,40.5,1.781,44,0 61 | 0,105,64,41,142,41.5,0.173,22,0 62 | 2,84,0,0,0,0,0.304,21,0 63 | 8,133,72,0,0,32.9,0.27,39,1 64 | 5,44,62,0,0,25,0.587,36,0 65 | 2,141,58,34,128,25.4,0.699,24,0 66 | 7,114,66,0,0,32.8,0.258,42,1 67 | 5,99,74,27,0,29,0.203,32,0 68 | 0,109,88,30,0,32.5,0.855,38,1 69 | 2,109,92,0,0,42.7,0.845,54,0 70 | 1,95,66,13,38,19.6,0.334,25,0 71 | 4,146,85,27,100,28.9,0.189,27,0 72 | 2,100,66,20,90,32.9,0.867,28,1 73 | 5,139,64,35,140,28.6,0.411,26,0 74 | 13,126,90,0,0,43.4,0.583,42,1 75 | 4,129,86,20,270,35.1,0.231,23,0 76 | 1,79,75,30,0,32,0.396,22,0 77 | 1,0,48,20,0,24.7,0.14,22,0 78 | 7,62,78,0,0,32.6,0.391,41,0 79 | 5,95,72,33,0,37.7,0.37,27,0 80 | 0,131,0,0,0,43.2,0.27,26,1 81 | 2,112,66,22,0,25,0.307,24,0 82 | 3,113,44,13,0,22.4,0.14,22,0 83 | 2,74,0,0,0,0,0.102,22,0 84 | 7,83,78,26,71,29.3,0.767,36,0 85 | 0,101,65,28,0,24.6,0.237,22,0 86 | 5,137,108,0,0,48.8,0.227,37,1 87 | 2,110,74,29,125,32.4,0.698,27,0 88 | 13,106,72,54,0,36.6,0.178,45,0 89 | 2,100,68,25,71,38.5,0.324,26,0 90 | 15,136,70,32,110,37.1,0.153,43,1 91 | 1,107,68,19,0,26.5,0.165,24,0 92 | 1,80,55,0,0,19.1,0.258,21,0 93 | 4,123,80,15,176,32,0.443,34,0 94 | 7,81,78,40,48,46.7,0.261,42,0 95 | 4,134,72,0,0,23.8,0.277,60,1 96 | 2,142,82,18,64,24.7,0.761,21,0 97 | 6,144,72,27,228,33.9,0.255,40,0 98 | 2,92,62,28,0,31.6,0.13,24,0 99 | 1,71,48,18,76,20.4,0.323,22,0 100 | 6,93,50,30,64,28.7,0.356,23,0 101 | 1,122,90,51,220,49.7,0.325,31,1 102 | 1,163,72,0,0,39,1.222,33,1 103 | 1,151,60,0,0,26.1,0.179,22,0 104 | 0,125,96,0,0,22.5,0.262,21,0 105 | 1,81,72,18,40,26.6,0.283,24,0 106 | 2,85,65,0,0,39.6,0.93,27,0 107 | 1,126,56,29,152,28.7,0.801,21,0 108 | 1,96,122,0,0,22.4,0.207,27,0 109 | 4,144,58,28,140,29.5,0.287,37,0 110 | 3,83,58,31,18,34.3,0.336,25,0 111 | 0,95,85,25,36,37.4,0.247,24,1 112 | 3,171,72,33,135,33.3,0.199,24,1 113 | 8,155,62,26,495,34,0.543,46,1 114 | 1,89,76,34,37,31.2,0.192,23,0 115 | 4,76,62,0,0,34,0.391,25,0 116 | 7,160,54,32,175,30.5,0.588,39,1 117 | 4,146,92,0,0,31.2,0.539,61,1 118 | 5,124,74,0,0,34,0.22,38,1 119 | 5,78,48,0,0,33.7,0.654,25,0 120 | 4,97,60,23,0,28.2,0.443,22,0 121 | 4,99,76,15,51,23.2,0.223,21,0 122 | 0,162,76,56,100,53.2,0.759,25,1 123 | 6,111,64,39,0,34.2,0.26,24,0 124 | 2,107,74,30,100,33.6,0.404,23,0 125 | 5,132,80,0,0,26.8,0.186,69,0 126 | 0,113,76,0,0,33.3,0.278,23,1 127 | 1,88,30,42,99,55,0.496,26,1 128 | 3,120,70,30,135,42.9,0.452,30,0 129 | 1,118,58,36,94,33.3,0.261,23,0 130 | 1,117,88,24,145,34.5,0.403,40,1 131 | 0,105,84,0,0,27.9,0.741,62,1 132 | 4,173,70,14,168,29.7,0.361,33,1 133 | 9,122,56,0,0,33.3,1.114,33,1 134 | 3,170,64,37,225,34.5,0.356,30,1 135 | 8,84,74,31,0,38.3,0.457,39,0 136 | 2,96,68,13,49,21.1,0.647,26,0 137 | 2,125,60,20,140,33.8,0.088,31,0 138 | 0,100,70,26,50,30.8,0.597,21,0 139 | 0,93,60,25,92,28.7,0.532,22,0 140 | 0,129,80,0,0,31.2,0.703,29,0 141 | 5,105,72,29,325,36.9,0.159,28,0 142 | 3,128,78,0,0,21.1,0.268,55,0 143 | 5,106,82,30,0,39.5,0.286,38,0 144 | 2,108,52,26,63,32.5,0.318,22,0 145 | 10,108,66,0,0,32.4,0.272,42,1 146 | 4,154,62,31,284,32.8,0.237,23,0 147 | 0,102,75,23,0,0,0.572,21,0 148 | 9,57,80,37,0,32.8,0.096,41,0 149 | 2,106,64,35,119,30.5,1.4,34,0 150 | 5,147,78,0,0,33.7,0.218,65,0 151 | 2,90,70,17,0,27.3,0.085,22,0 152 | 1,136,74,50,204,37.4,0.399,24,0 153 | 4,114,65,0,0,21.9,0.432,37,0 154 | 9,156,86,28,155,34.3,1.189,42,1 155 | 1,153,82,42,485,40.6,0.687,23,0 156 | 8,188,78,0,0,47.9,0.137,43,1 157 | 7,152,88,44,0,50,0.337,36,1 158 | 2,99,52,15,94,24.6,0.637,21,0 159 | 1,109,56,21,135,25.2,0.833,23,0 160 | 2,88,74,19,53,29,0.229,22,0 161 | 17,163,72,41,114,40.9,0.817,47,1 162 | 4,151,90,38,0,29.7,0.294,36,0 163 | 7,102,74,40,105,37.2,0.204,45,0 164 | 0,114,80,34,285,44.2,0.167,27,0 165 | 2,100,64,23,0,29.7,0.368,21,0 166 | 0,131,88,0,0,31.6,0.743,32,1 167 | 6,104,74,18,156,29.9,0.722,41,1 168 | 3,148,66,25,0,32.5,0.256,22,0 169 | 4,120,68,0,0,29.6,0.709,34,0 170 | 4,110,66,0,0,31.9,0.471,29,0 171 | 3,111,90,12,78,28.4,0.495,29,0 172 | 6,102,82,0,0,30.8,0.18,36,1 173 | 6,134,70,23,130,35.4,0.542,29,1 174 | 2,87,0,23,0,28.9,0.773,25,0 175 | 1,79,60,42,48,43.5,0.678,23,0 176 | 2,75,64,24,55,29.7,0.37,33,0 177 | 8,179,72,42,130,32.7,0.719,36,1 178 | 6,85,78,0,0,31.2,0.382,42,0 179 | 0,129,110,46,130,67.1,0.319,26,1 180 | 5,143,78,0,0,45,0.19,47,0 181 | 5,130,82,0,0,39.1,0.956,37,1 182 | 6,87,80,0,0,23.2,0.084,32,0 183 | 0,119,64,18,92,34.9,0.725,23,0 184 | 1,0,74,20,23,27.7,0.299,21,0 185 | 5,73,60,0,0,26.8,0.268,27,0 186 | 4,141,74,0,0,27.6,0.244,40,0 187 | 7,194,68,28,0,35.9,0.745,41,1 188 | 8,181,68,36,495,30.1,0.615,60,1 189 | 1,128,98,41,58,32,1.321,33,1 190 | 8,109,76,39,114,27.9,0.64,31,1 191 | 5,139,80,35,160,31.6,0.361,25,1 192 | 3,111,62,0,0,22.6,0.142,21,0 193 | 9,123,70,44,94,33.1,0.374,40,0 194 | 7,159,66,0,0,30.4,0.383,36,1 195 | 11,135,0,0,0,52.3,0.578,40,1 196 | 8,85,55,20,0,24.4,0.136,42,0 197 | 5,158,84,41,210,39.4,0.395,29,1 198 | 1,105,58,0,0,24.3,0.187,21,0 199 | 3,107,62,13,48,22.9,0.678,23,1 200 | 4,109,64,44,99,34.8,0.905,26,1 201 | 4,148,60,27,318,30.9,0.15,29,1 202 | 0,113,80,16,0,31,0.874,21,0 203 | 1,138,82,0,0,40.1,0.236,28,0 204 | 0,108,68,20,0,27.3,0.787,32,0 205 | 2,99,70,16,44,20.4,0.235,27,0 206 | 6,103,72,32,190,37.7,0.324,55,0 207 | 5,111,72,28,0,23.9,0.407,27,0 208 | 8,196,76,29,280,37.5,0.605,57,1 209 | 5,162,104,0,0,37.7,0.151,52,1 210 | 1,96,64,27,87,33.2,0.289,21,0 211 | 7,184,84,33,0,35.5,0.355,41,1 212 | 2,81,60,22,0,27.7,0.29,25,0 213 | 0,147,85,54,0,42.8,0.375,24,0 214 | 7,179,95,31,0,34.2,0.164,60,0 215 | 0,140,65,26,130,42.6,0.431,24,1 216 | 9,112,82,32,175,34.2,0.26,36,1 217 | 12,151,70,40,271,41.8,0.742,38,1 218 | 5,109,62,41,129,35.8,0.514,25,1 219 | 6,125,68,30,120,30,0.464,32,0 220 | 5,85,74,22,0,29,1.224,32,1 221 | 5,112,66,0,0,37.8,0.261,41,1 222 | 0,177,60,29,478,34.6,1.072,21,1 223 | 2,158,90,0,0,31.6,0.805,66,1 224 | 7,119,0,0,0,25.2,0.209,37,0 225 | 7,142,60,33,190,28.8,0.687,61,0 226 | 1,100,66,15,56,23.6,0.666,26,0 227 | 1,87,78,27,32,34.6,0.101,22,0 228 | 0,101,76,0,0,35.7,0.198,26,0 229 | 3,162,52,38,0,37.2,0.652,24,1 230 | 4,197,70,39,744,36.7,2.329,31,0 231 | 0,117,80,31,53,45.2,0.089,24,0 232 | 4,142,86,0,0,44,0.645,22,1 233 | 6,134,80,37,370,46.2,0.238,46,1 234 | 1,79,80,25,37,25.4,0.583,22,0 235 | 4,122,68,0,0,35,0.394,29,0 236 | 3,74,68,28,45,29.7,0.293,23,0 237 | 4,171,72,0,0,43.6,0.479,26,1 238 | 7,181,84,21,192,35.9,0.586,51,1 239 | 0,179,90,27,0,44.1,0.686,23,1 240 | 9,164,84,21,0,30.8,0.831,32,1 241 | 0,104,76,0,0,18.4,0.582,27,0 242 | 1,91,64,24,0,29.2,0.192,21,0 243 | 4,91,70,32,88,33.1,0.446,22,0 244 | 3,139,54,0,0,25.6,0.402,22,1 245 | 6,119,50,22,176,27.1,1.318,33,1 246 | 2,146,76,35,194,38.2,0.329,29,0 247 | 9,184,85,15,0,30,1.213,49,1 248 | 10,122,68,0,0,31.2,0.258,41,0 249 | 0,165,90,33,680,52.3,0.427,23,0 250 | 9,124,70,33,402,35.4,0.282,34,0 251 | 1,111,86,19,0,30.1,0.143,23,0 252 | 9,106,52,0,0,31.2,0.38,42,0 253 | 2,129,84,0,0,28,0.284,27,0 254 | 2,90,80,14,55,24.4,0.249,24,0 255 | 0,86,68,32,0,35.8,0.238,25,0 256 | 12,92,62,7,258,27.6,0.926,44,1 257 | 1,113,64,35,0,33.6,0.543,21,1 258 | 3,111,56,39,0,30.1,0.557,30,0 259 | 2,114,68,22,0,28.7,0.092,25,0 260 | 1,193,50,16,375,25.9,0.655,24,0 261 | 11,155,76,28,150,33.3,1.353,51,1 262 | 3,191,68,15,130,30.9,0.299,34,0 263 | 3,141,0,0,0,30,0.761,27,1 264 | 4,95,70,32,0,32.1,0.612,24,0 265 | 3,142,80,15,0,32.4,0.2,63,0 266 | 4,123,62,0,0,32,0.226,35,1 267 | 5,96,74,18,67,33.6,0.997,43,0 268 | 0,138,0,0,0,36.3,0.933,25,1 269 | 2,128,64,42,0,40,1.101,24,0 270 | 0,102,52,0,0,25.1,0.078,21,0 271 | 2,146,0,0,0,27.5,0.24,28,1 272 | 10,101,86,37,0,45.6,1.136,38,1 273 | 2,108,62,32,56,25.2,0.128,21,0 274 | 3,122,78,0,0,23,0.254,40,0 275 | 1,71,78,50,45,33.2,0.422,21,0 276 | 13,106,70,0,0,34.2,0.251,52,0 277 | 2,100,70,52,57,40.5,0.677,25,0 278 | 7,106,60,24,0,26.5,0.296,29,1 279 | 0,104,64,23,116,27.8,0.454,23,0 280 | 5,114,74,0,0,24.9,0.744,57,0 281 | 2,108,62,10,278,25.3,0.881,22,0 282 | 0,146,70,0,0,37.9,0.334,28,1 283 | 10,129,76,28,122,35.9,0.28,39,0 284 | 7,133,88,15,155,32.4,0.262,37,0 285 | 7,161,86,0,0,30.4,0.165,47,1 286 | 2,108,80,0,0,27,0.259,52,1 287 | 7,136,74,26,135,26,0.647,51,0 288 | 5,155,84,44,545,38.7,0.619,34,0 289 | 1,119,86,39,220,45.6,0.808,29,1 290 | 4,96,56,17,49,20.8,0.34,26,0 291 | 5,108,72,43,75,36.1,0.263,33,0 292 | 0,78,88,29,40,36.9,0.434,21,0 293 | 0,107,62,30,74,36.6,0.757,25,1 294 | 2,128,78,37,182,43.3,1.224,31,1 295 | 1,128,48,45,194,40.5,0.613,24,1 296 | 0,161,50,0,0,21.9,0.254,65,0 297 | 6,151,62,31,120,35.5,0.692,28,0 298 | 2,146,70,38,360,28,0.337,29,1 299 | 0,126,84,29,215,30.7,0.52,24,0 300 | 14,100,78,25,184,36.6,0.412,46,1 301 | 8,112,72,0,0,23.6,0.84,58,0 302 | 0,167,0,0,0,32.3,0.839,30,1 303 | 2,144,58,33,135,31.6,0.422,25,1 304 | 5,77,82,41,42,35.8,0.156,35,0 305 | 5,115,98,0,0,52.9,0.209,28,1 306 | 3,150,76,0,0,21,0.207,37,0 307 | 2,120,76,37,105,39.7,0.215,29,0 308 | 10,161,68,23,132,25.5,0.326,47,1 309 | 0,137,68,14,148,24.8,0.143,21,0 310 | 0,128,68,19,180,30.5,1.391,25,1 311 | 2,124,68,28,205,32.9,0.875,30,1 312 | 6,80,66,30,0,26.2,0.313,41,0 313 | 0,106,70,37,148,39.4,0.605,22,0 314 | 2,155,74,17,96,26.6,0.433,27,1 315 | 3,113,50,10,85,29.5,0.626,25,0 316 | 7,109,80,31,0,35.9,1.127,43,1 317 | 2,112,68,22,94,34.1,0.315,26,0 318 | 3,99,80,11,64,19.3,0.284,30,0 319 | 3,182,74,0,0,30.5,0.345,29,1 320 | 3,115,66,39,140,38.1,0.15,28,0 321 | 6,194,78,0,0,23.5,0.129,59,1 322 | 4,129,60,12,231,27.5,0.527,31,0 323 | 3,112,74,30,0,31.6,0.197,25,1 324 | 0,124,70,20,0,27.4,0.254,36,1 325 | 13,152,90,33,29,26.8,0.731,43,1 326 | 2,112,75,32,0,35.7,0.148,21,0 327 | 1,157,72,21,168,25.6,0.123,24,0 328 | 1,122,64,32,156,35.1,0.692,30,1 329 | 10,179,70,0,0,35.1,0.2,37,0 330 | 2,102,86,36,120,45.5,0.127,23,1 331 | 6,105,70,32,68,30.8,0.122,37,0 332 | 8,118,72,19,0,23.1,1.476,46,0 333 | 2,87,58,16,52,32.7,0.166,25,0 334 | 1,180,0,0,0,43.3,0.282,41,1 335 | 12,106,80,0,0,23.6,0.137,44,0 336 | 1,95,60,18,58,23.9,0.26,22,0 337 | 0,165,76,43,255,47.9,0.259,26,0 338 | 0,117,0,0,0,33.8,0.932,44,0 339 | 5,115,76,0,0,31.2,0.343,44,1 340 | 9,152,78,34,171,34.2,0.893,33,1 341 | 7,178,84,0,0,39.9,0.331,41,1 342 | 1,130,70,13,105,25.9,0.472,22,0 343 | 1,95,74,21,73,25.9,0.673,36,0 344 | 1,0,68,35,0,32,0.389,22,0 345 | 5,122,86,0,0,34.7,0.29,33,0 346 | 8,95,72,0,0,36.8,0.485,57,0 347 | 8,126,88,36,108,38.5,0.349,49,0 348 | 1,139,46,19,83,28.7,0.654,22,0 349 | 3,116,0,0,0,23.5,0.187,23,0 350 | 3,99,62,19,74,21.8,0.279,26,0 351 | 5,0,80,32,0,41,0.346,37,1 352 | 4,92,80,0,0,42.2,0.237,29,0 353 | 4,137,84,0,0,31.2,0.252,30,0 354 | 3,61,82,28,0,34.4,0.243,46,0 355 | 1,90,62,12,43,27.2,0.58,24,0 356 | 3,90,78,0,0,42.7,0.559,21,0 357 | 9,165,88,0,0,30.4,0.302,49,1 358 | 1,125,50,40,167,33.3,0.962,28,1 359 | 13,129,0,30,0,39.9,0.569,44,1 360 | 12,88,74,40,54,35.3,0.378,48,0 361 | 1,196,76,36,249,36.5,0.875,29,1 362 | 5,189,64,33,325,31.2,0.583,29,1 363 | 5,158,70,0,0,29.8,0.207,63,0 364 | 5,103,108,37,0,39.2,0.305,65,0 365 | 4,146,78,0,0,38.5,0.52,67,1 366 | 4,147,74,25,293,34.9,0.385,30,0 367 | 5,99,54,28,83,34,0.499,30,0 368 | 6,124,72,0,0,27.6,0.368,29,1 369 | 0,101,64,17,0,21,0.252,21,0 370 | 3,81,86,16,66,27.5,0.306,22,0 371 | 1,133,102,28,140,32.8,0.234,45,1 372 | 3,173,82,48,465,38.4,2.137,25,1 373 | 0,118,64,23,89,0,1.731,21,0 374 | 0,84,64,22,66,35.8,0.545,21,0 375 | 2,105,58,40,94,34.9,0.225,25,0 376 | 2,122,52,43,158,36.2,0.816,28,0 377 | 12,140,82,43,325,39.2,0.528,58,1 378 | 0,98,82,15,84,25.2,0.299,22,0 379 | 1,87,60,37,75,37.2,0.509,22,0 380 | 4,156,75,0,0,48.3,0.238,32,1 381 | 0,93,100,39,72,43.4,1.021,35,0 382 | 1,107,72,30,82,30.8,0.821,24,0 383 | 0,105,68,22,0,20,0.236,22,0 384 | 1,109,60,8,182,25.4,0.947,21,0 385 | 1,90,62,18,59,25.1,1.268,25,0 386 | 1,125,70,24,110,24.3,0.221,25,0 387 | 1,119,54,13,50,22.3,0.205,24,0 388 | 5,116,74,29,0,32.3,0.66,35,1 389 | 8,105,100,36,0,43.3,0.239,45,1 390 | 5,144,82,26,285,32,0.452,58,1 391 | 3,100,68,23,81,31.6,0.949,28,0 392 | 1,100,66,29,196,32,0.444,42,0 393 | 5,166,76,0,0,45.7,0.34,27,1 394 | 1,131,64,14,415,23.7,0.389,21,0 395 | 4,116,72,12,87,22.1,0.463,37,0 396 | 4,158,78,0,0,32.9,0.803,31,1 397 | 2,127,58,24,275,27.7,1.6,25,0 398 | 3,96,56,34,115,24.7,0.944,39,0 399 | 0,131,66,40,0,34.3,0.196,22,1 400 | 3,82,70,0,0,21.1,0.389,25,0 401 | 3,193,70,31,0,34.9,0.241,25,1 402 | 4,95,64,0,0,32,0.161,31,1 403 | 6,137,61,0,0,24.2,0.151,55,0 404 | 5,136,84,41,88,35,0.286,35,1 405 | 9,72,78,25,0,31.6,0.28,38,0 406 | 5,168,64,0,0,32.9,0.135,41,1 407 | 2,123,48,32,165,42.1,0.52,26,0 408 | 4,115,72,0,0,28.9,0.376,46,1 409 | 0,101,62,0,0,21.9,0.336,25,0 410 | 8,197,74,0,0,25.9,1.191,39,1 411 | 1,172,68,49,579,42.4,0.702,28,1 412 | 6,102,90,39,0,35.7,0.674,28,0 413 | 1,112,72,30,176,34.4,0.528,25,0 414 | 1,143,84,23,310,42.4,1.076,22,0 415 | 1,143,74,22,61,26.2,0.256,21,0 416 | 0,138,60,35,167,34.6,0.534,21,1 417 | 3,173,84,33,474,35.7,0.258,22,1 418 | 1,97,68,21,0,27.2,1.095,22,0 419 | 4,144,82,32,0,38.5,0.554,37,1 420 | 1,83,68,0,0,18.2,0.624,27,0 421 | 3,129,64,29,115,26.4,0.219,28,1 422 | 1,119,88,41,170,45.3,0.507,26,0 423 | 2,94,68,18,76,26,0.561,21,0 424 | 0,102,64,46,78,40.6,0.496,21,0 425 | 2,115,64,22,0,30.8,0.421,21,0 426 | 8,151,78,32,210,42.9,0.516,36,1 427 | 4,184,78,39,277,37,0.264,31,1 428 | 0,94,0,0,0,0,0.256,25,0 429 | 1,181,64,30,180,34.1,0.328,38,1 430 | 0,135,94,46,145,40.6,0.284,26,0 431 | 1,95,82,25,180,35,0.233,43,1 432 | 2,99,0,0,0,22.2,0.108,23,0 433 | 3,89,74,16,85,30.4,0.551,38,0 434 | 1,80,74,11,60,30,0.527,22,0 435 | 2,139,75,0,0,25.6,0.167,29,0 436 | 1,90,68,8,0,24.5,1.138,36,0 437 | 0,141,0,0,0,42.4,0.205,29,1 438 | 12,140,85,33,0,37.4,0.244,41,0 439 | 5,147,75,0,0,29.9,0.434,28,0 440 | 1,97,70,15,0,18.2,0.147,21,0 441 | 6,107,88,0,0,36.8,0.727,31,0 442 | 0,189,104,25,0,34.3,0.435,41,1 443 | 2,83,66,23,50,32.2,0.497,22,0 444 | 4,117,64,27,120,33.2,0.23,24,0 445 | 8,108,70,0,0,30.5,0.955,33,1 446 | 4,117,62,12,0,29.7,0.38,30,1 447 | 0,180,78,63,14,59.4,2.42,25,1 448 | 1,100,72,12,70,25.3,0.658,28,0 449 | 0,95,80,45,92,36.5,0.33,26,0 450 | 0,104,64,37,64,33.6,0.51,22,1 451 | 0,120,74,18,63,30.5,0.285,26,0 452 | 1,82,64,13,95,21.2,0.415,23,0 453 | 2,134,70,0,0,28.9,0.542,23,1 454 | 0,91,68,32,210,39.9,0.381,25,0 455 | 2,119,0,0,0,19.6,0.832,72,0 456 | 2,100,54,28,105,37.8,0.498,24,0 457 | 14,175,62,30,0,33.6,0.212,38,1 458 | 1,135,54,0,0,26.7,0.687,62,0 459 | 5,86,68,28,71,30.2,0.364,24,0 460 | 10,148,84,48,237,37.6,1.001,51,1 461 | 9,134,74,33,60,25.9,0.46,81,0 462 | 9,120,72,22,56,20.8,0.733,48,0 463 | 1,71,62,0,0,21.8,0.416,26,0 464 | 8,74,70,40,49,35.3,0.705,39,0 465 | 5,88,78,30,0,27.6,0.258,37,0 466 | 10,115,98,0,0,24,1.022,34,0 467 | 0,124,56,13,105,21.8,0.452,21,0 468 | 0,74,52,10,36,27.8,0.269,22,0 469 | 0,97,64,36,100,36.8,0.6,25,0 470 | 8,120,0,0,0,30,0.183,38,1 471 | 6,154,78,41,140,46.1,0.571,27,0 472 | 1,144,82,40,0,41.3,0.607,28,0 473 | 0,137,70,38,0,33.2,0.17,22,0 474 | 0,119,66,27,0,38.8,0.259,22,0 475 | 7,136,90,0,0,29.9,0.21,50,0 476 | 4,114,64,0,0,28.9,0.126,24,0 477 | 0,137,84,27,0,27.3,0.231,59,0 478 | 2,105,80,45,191,33.7,0.711,29,1 479 | 7,114,76,17,110,23.8,0.466,31,0 480 | 8,126,74,38,75,25.9,0.162,39,0 481 | 4,132,86,31,0,28,0.419,63,0 482 | 3,158,70,30,328,35.5,0.344,35,1 483 | 0,123,88,37,0,35.2,0.197,29,0 484 | 4,85,58,22,49,27.8,0.306,28,0 485 | 0,84,82,31,125,38.2,0.233,23,0 486 | 0,145,0,0,0,44.2,0.63,31,1 487 | 0,135,68,42,250,42.3,0.365,24,1 488 | 1,139,62,41,480,40.7,0.536,21,0 489 | 0,173,78,32,265,46.5,1.159,58,0 490 | 4,99,72,17,0,25.6,0.294,28,0 491 | 8,194,80,0,0,26.1,0.551,67,0 492 | 2,83,65,28,66,36.8,0.629,24,0 493 | 2,89,90,30,0,33.5,0.292,42,0 494 | 4,99,68,38,0,32.8,0.145,33,0 495 | 4,125,70,18,122,28.9,1.144,45,1 496 | 3,80,0,0,0,0,0.174,22,0 497 | 6,166,74,0,0,26.6,0.304,66,0 498 | 5,110,68,0,0,26,0.292,30,0 499 | 2,81,72,15,76,30.1,0.547,25,0 500 | 7,195,70,33,145,25.1,0.163,55,1 501 | 6,154,74,32,193,29.3,0.839,39,0 502 | 2,117,90,19,71,25.2,0.313,21,0 503 | 3,84,72,32,0,37.2,0.267,28,0 504 | 6,0,68,41,0,39,0.727,41,1 505 | 7,94,64,25,79,33.3,0.738,41,0 506 | 3,96,78,39,0,37.3,0.238,40,0 507 | 10,75,82,0,0,33.3,0.263,38,0 508 | 0,180,90,26,90,36.5,0.314,35,1 509 | 1,130,60,23,170,28.6,0.692,21,0 510 | 2,84,50,23,76,30.4,0.968,21,0 511 | 8,120,78,0,0,25,0.409,64,0 512 | 12,84,72,31,0,29.7,0.297,46,1 513 | 0,139,62,17,210,22.1,0.207,21,0 514 | 9,91,68,0,0,24.2,0.2,58,0 515 | 2,91,62,0,0,27.3,0.525,22,0 516 | 3,99,54,19,86,25.6,0.154,24,0 517 | 3,163,70,18,105,31.6,0.268,28,1 518 | 9,145,88,34,165,30.3,0.771,53,1 519 | 7,125,86,0,0,37.6,0.304,51,0 520 | 13,76,60,0,0,32.8,0.18,41,0 521 | 6,129,90,7,326,19.6,0.582,60,0 522 | 2,68,70,32,66,25,0.187,25,0 523 | 3,124,80,33,130,33.2,0.305,26,0 524 | 6,114,0,0,0,0,0.189,26,0 525 | 9,130,70,0,0,34.2,0.652,45,1 526 | 3,125,58,0,0,31.6,0.151,24,0 527 | 3,87,60,18,0,21.8,0.444,21,0 528 | 1,97,64,19,82,18.2,0.299,21,0 529 | 3,116,74,15,105,26.3,0.107,24,0 530 | 0,117,66,31,188,30.8,0.493,22,0 531 | 0,111,65,0,0,24.6,0.66,31,0 532 | 2,122,60,18,106,29.8,0.717,22,0 533 | 0,107,76,0,0,45.3,0.686,24,0 534 | 1,86,66,52,65,41.3,0.917,29,0 535 | 6,91,0,0,0,29.8,0.501,31,0 536 | 1,77,56,30,56,33.3,1.251,24,0 537 | 4,132,0,0,0,32.9,0.302,23,1 538 | 0,105,90,0,0,29.6,0.197,46,0 539 | 0,57,60,0,0,21.7,0.735,67,0 540 | 0,127,80,37,210,36.3,0.804,23,0 541 | 3,129,92,49,155,36.4,0.968,32,1 542 | 8,100,74,40,215,39.4,0.661,43,1 543 | 3,128,72,25,190,32.4,0.549,27,1 544 | 10,90,85,32,0,34.9,0.825,56,1 545 | 4,84,90,23,56,39.5,0.159,25,0 546 | 1,88,78,29,76,32,0.365,29,0 547 | 8,186,90,35,225,34.5,0.423,37,1 548 | 5,187,76,27,207,43.6,1.034,53,1 549 | 4,131,68,21,166,33.1,0.16,28,0 550 | 1,164,82,43,67,32.8,0.341,50,0 551 | 4,189,110,31,0,28.5,0.68,37,0 552 | 1,116,70,28,0,27.4,0.204,21,0 553 | 3,84,68,30,106,31.9,0.591,25,0 554 | 6,114,88,0,0,27.8,0.247,66,0 555 | 1,88,62,24,44,29.9,0.422,23,0 556 | 1,84,64,23,115,36.9,0.471,28,0 557 | 7,124,70,33,215,25.5,0.161,37,0 558 | 1,97,70,40,0,38.1,0.218,30,0 559 | 8,110,76,0,0,27.8,0.237,58,0 560 | 11,103,68,40,0,46.2,0.126,42,0 561 | 11,85,74,0,0,30.1,0.3,35,0 562 | 6,125,76,0,0,33.8,0.121,54,1 563 | 0,198,66,32,274,41.3,0.502,28,1 564 | 1,87,68,34,77,37.6,0.401,24,0 565 | 6,99,60,19,54,26.9,0.497,32,0 566 | 0,91,80,0,0,32.4,0.601,27,0 567 | 2,95,54,14,88,26.1,0.748,22,0 568 | 1,99,72,30,18,38.6,0.412,21,0 569 | 6,92,62,32,126,32,0.085,46,0 570 | 4,154,72,29,126,31.3,0.338,37,0 571 | 0,121,66,30,165,34.3,0.203,33,1 572 | 3,78,70,0,0,32.5,0.27,39,0 573 | 2,130,96,0,0,22.6,0.268,21,0 574 | 3,111,58,31,44,29.5,0.43,22,0 575 | 2,98,60,17,120,34.7,0.198,22,0 576 | 1,143,86,30,330,30.1,0.892,23,0 577 | 1,119,44,47,63,35.5,0.28,25,0 578 | 6,108,44,20,130,24,0.813,35,0 579 | 2,118,80,0,0,42.9,0.693,21,1 580 | 10,133,68,0,0,27,0.245,36,0 581 | 2,197,70,99,0,34.7,0.575,62,1 582 | 0,151,90,46,0,42.1,0.371,21,1 583 | 6,109,60,27,0,25,0.206,27,0 584 | 12,121,78,17,0,26.5,0.259,62,0 585 | 8,100,76,0,0,38.7,0.19,42,0 586 | 8,124,76,24,600,28.7,0.687,52,1 587 | 1,93,56,11,0,22.5,0.417,22,0 588 | 8,143,66,0,0,34.9,0.129,41,1 589 | 6,103,66,0,0,24.3,0.249,29,0 590 | 3,176,86,27,156,33.3,1.154,52,1 591 | 0,73,0,0,0,21.1,0.342,25,0 592 | 11,111,84,40,0,46.8,0.925,45,1 593 | 2,112,78,50,140,39.4,0.175,24,0 594 | 3,132,80,0,0,34.4,0.402,44,1 595 | 2,82,52,22,115,28.5,1.699,25,0 596 | 6,123,72,45,230,33.6,0.733,34,0 597 | 0,188,82,14,185,32,0.682,22,1 598 | 0,67,76,0,0,45.3,0.194,46,0 599 | 1,89,24,19,25,27.8,0.559,21,0 600 | 1,173,74,0,0,36.8,0.088,38,1 601 | 1,109,38,18,120,23.1,0.407,26,0 602 | 1,108,88,19,0,27.1,0.4,24,0 603 | 6,96,0,0,0,23.7,0.19,28,0 604 | 1,124,74,36,0,27.8,0.1,30,0 605 | 7,150,78,29,126,35.2,0.692,54,1 606 | 4,183,0,0,0,28.4,0.212,36,1 607 | 1,124,60,32,0,35.8,0.514,21,0 608 | 1,181,78,42,293,40,1.258,22,1 609 | 1,92,62,25,41,19.5,0.482,25,0 610 | 0,152,82,39,272,41.5,0.27,27,0 611 | 1,111,62,13,182,24,0.138,23,0 612 | 3,106,54,21,158,30.9,0.292,24,0 613 | 3,174,58,22,194,32.9,0.593,36,1 614 | 7,168,88,42,321,38.2,0.787,40,1 615 | 6,105,80,28,0,32.5,0.878,26,0 616 | 11,138,74,26,144,36.1,0.557,50,1 617 | 3,106,72,0,0,25.8,0.207,27,0 618 | 6,117,96,0,0,28.7,0.157,30,0 619 | 2,68,62,13,15,20.1,0.257,23,0 620 | 9,112,82,24,0,28.2,1.282,50,1 621 | 0,119,0,0,0,32.4,0.141,24,1 622 | 2,112,86,42,160,38.4,0.246,28,0 623 | 2,92,76,20,0,24.2,1.698,28,0 624 | 6,183,94,0,0,40.8,1.461,45,0 625 | 0,94,70,27,115,43.5,0.347,21,0 626 | 2,108,64,0,0,30.8,0.158,21,0 627 | 4,90,88,47,54,37.7,0.362,29,0 628 | 0,125,68,0,0,24.7,0.206,21,0 629 | 0,132,78,0,0,32.4,0.393,21,0 630 | 5,128,80,0,0,34.6,0.144,45,0 631 | 4,94,65,22,0,24.7,0.148,21,0 632 | 7,114,64,0,0,27.4,0.732,34,1 633 | 0,102,78,40,90,34.5,0.238,24,0 634 | 2,111,60,0,0,26.2,0.343,23,0 635 | 1,128,82,17,183,27.5,0.115,22,0 636 | 10,92,62,0,0,25.9,0.167,31,0 637 | 13,104,72,0,0,31.2,0.465,38,1 638 | 5,104,74,0,0,28.8,0.153,48,0 639 | 2,94,76,18,66,31.6,0.649,23,0 640 | 7,97,76,32,91,40.9,0.871,32,1 641 | 1,100,74,12,46,19.5,0.149,28,0 642 | 0,102,86,17,105,29.3,0.695,27,0 643 | 4,128,70,0,0,34.3,0.303,24,0 644 | 6,147,80,0,0,29.5,0.178,50,1 645 | 4,90,0,0,0,28,0.61,31,0 646 | 3,103,72,30,152,27.6,0.73,27,0 647 | 2,157,74,35,440,39.4,0.134,30,0 648 | 1,167,74,17,144,23.4,0.447,33,1 649 | 0,179,50,36,159,37.8,0.455,22,1 650 | 11,136,84,35,130,28.3,0.26,42,1 651 | 0,107,60,25,0,26.4,0.133,23,0 652 | 1,91,54,25,100,25.2,0.234,23,0 653 | 1,117,60,23,106,33.8,0.466,27,0 654 | 5,123,74,40,77,34.1,0.269,28,0 655 | 2,120,54,0,0,26.8,0.455,27,0 656 | 1,106,70,28,135,34.2,0.142,22,0 657 | 2,155,52,27,540,38.7,0.24,25,1 658 | 2,101,58,35,90,21.8,0.155,22,0 659 | 1,120,80,48,200,38.9,1.162,41,0 660 | 11,127,106,0,0,39,0.19,51,0 661 | 3,80,82,31,70,34.2,1.292,27,1 662 | 10,162,84,0,0,27.7,0.182,54,0 663 | 1,199,76,43,0,42.9,1.394,22,1 664 | 8,167,106,46,231,37.6,0.165,43,1 665 | 9,145,80,46,130,37.9,0.637,40,1 666 | 6,115,60,39,0,33.7,0.245,40,1 667 | 1,112,80,45,132,34.8,0.217,24,0 668 | 4,145,82,18,0,32.5,0.235,70,1 669 | 10,111,70,27,0,27.5,0.141,40,1 670 | 6,98,58,33,190,34,0.43,43,0 671 | 9,154,78,30,100,30.9,0.164,45,0 672 | 6,165,68,26,168,33.6,0.631,49,0 673 | 1,99,58,10,0,25.4,0.551,21,0 674 | 10,68,106,23,49,35.5,0.285,47,0 675 | 3,123,100,35,240,57.3,0.88,22,0 676 | 8,91,82,0,0,35.6,0.587,68,0 677 | 6,195,70,0,0,30.9,0.328,31,1 678 | 9,156,86,0,0,24.8,0.23,53,1 679 | 0,93,60,0,0,35.3,0.263,25,0 680 | 3,121,52,0,0,36,0.127,25,1 681 | 2,101,58,17,265,24.2,0.614,23,0 682 | 2,56,56,28,45,24.2,0.332,22,0 683 | 0,162,76,36,0,49.6,0.364,26,1 684 | 0,95,64,39,105,44.6,0.366,22,0 685 | 4,125,80,0,0,32.3,0.536,27,1 686 | 5,136,82,0,0,0,0.64,69,0 687 | 2,129,74,26,205,33.2,0.591,25,0 688 | 3,130,64,0,0,23.1,0.314,22,0 689 | 1,107,50,19,0,28.3,0.181,29,0 690 | 1,140,74,26,180,24.1,0.828,23,0 691 | 1,144,82,46,180,46.1,0.335,46,1 692 | 8,107,80,0,0,24.6,0.856,34,0 693 | 13,158,114,0,0,42.3,0.257,44,1 694 | 2,121,70,32,95,39.1,0.886,23,0 695 | 7,129,68,49,125,38.5,0.439,43,1 696 | 2,90,60,0,0,23.5,0.191,25,0 697 | 7,142,90,24,480,30.4,0.128,43,1 698 | 3,169,74,19,125,29.9,0.268,31,1 699 | 0,99,0,0,0,25,0.253,22,0 700 | 4,127,88,11,155,34.5,0.598,28,0 701 | 4,118,70,0,0,44.5,0.904,26,0 702 | 2,122,76,27,200,35.9,0.483,26,0 703 | 6,125,78,31,0,27.6,0.565,49,1 704 | 1,168,88,29,0,35,0.905,52,1 705 | 2,129,0,0,0,38.5,0.304,41,0 706 | 4,110,76,20,100,28.4,0.118,27,0 707 | 6,80,80,36,0,39.8,0.177,28,0 708 | 10,115,0,0,0,0,0.261,30,1 709 | 2,127,46,21,335,34.4,0.176,22,0 710 | 9,164,78,0,0,32.8,0.148,45,1 711 | 2,93,64,32,160,38,0.674,23,1 712 | 3,158,64,13,387,31.2,0.295,24,0 713 | 5,126,78,27,22,29.6,0.439,40,0 714 | 10,129,62,36,0,41.2,0.441,38,1 715 | 0,134,58,20,291,26.4,0.352,21,0 716 | 3,102,74,0,0,29.5,0.121,32,0 717 | 7,187,50,33,392,33.9,0.826,34,1 718 | 3,173,78,39,185,33.8,0.97,31,1 719 | 10,94,72,18,0,23.1,0.595,56,0 720 | 1,108,60,46,178,35.5,0.415,24,0 721 | 5,97,76,27,0,35.6,0.378,52,1 722 | 4,83,86,19,0,29.3,0.317,34,0 723 | 1,114,66,36,200,38.1,0.289,21,0 724 | 1,149,68,29,127,29.3,0.349,42,1 725 | 5,117,86,30,105,39.1,0.251,42,0 726 | 1,111,94,0,0,32.8,0.265,45,0 727 | 4,112,78,40,0,39.4,0.236,38,0 728 | 1,116,78,29,180,36.1,0.496,25,0 729 | 0,141,84,26,0,32.4,0.433,22,0 730 | 2,175,88,0,0,22.9,0.326,22,0 731 | 2,92,52,0,0,30.1,0.141,22,0 732 | 3,130,78,23,79,28.4,0.323,34,1 733 | 8,120,86,0,0,28.4,0.259,22,1 734 | 2,174,88,37,120,44.5,0.646,24,1 735 | 2,106,56,27,165,29,0.426,22,0 736 | 2,105,75,0,0,23.3,0.56,53,0 737 | 4,95,60,32,0,35.4,0.284,28,0 738 | 0,126,86,27,120,27.4,0.515,21,0 739 | 8,65,72,23,0,32,0.6,42,0 740 | 2,99,60,17,160,36.6,0.453,21,0 741 | 1,102,74,0,0,39.5,0.293,42,1 742 | 11,120,80,37,150,42.3,0.785,48,1 743 | 3,102,44,20,94,30.8,0.4,26,0 744 | 1,109,58,18,116,28.5,0.219,22,0 745 | 9,140,94,0,0,32.7,0.734,45,1 746 | 13,153,88,37,140,40.6,1.174,39,0 747 | 12,100,84,33,105,30,0.488,46,0 748 | 1,147,94,41,0,49.3,0.358,27,1 749 | 1,81,74,41,57,46.3,1.096,32,0 750 | 3,187,70,22,200,36.4,0.408,36,1 751 | 6,162,62,0,0,24.3,0.178,50,1 752 | 4,136,70,0,0,31.2,1.182,22,1 753 | 1,121,78,39,74,39,0.261,28,0 754 | 3,108,62,24,0,26,0.223,25,0 755 | 0,181,88,44,510,43.3,0.222,26,1 756 | 8,154,78,32,0,32.4,0.443,45,1 757 | 1,128,88,39,110,36.5,1.057,37,1 758 | 7,137,90,41,0,32,0.391,39,0 759 | 0,123,72,0,0,36.3,0.258,52,1 760 | 1,106,76,0,0,37.5,0.197,26,0 761 | 6,190,92,0,0,35.5,0.278,66,1 762 | 2,88,58,26,16,28.4,0.766,22,0 763 | 9,170,74,31,0,44,0.403,43,1 764 | 9,89,62,0,0,22.5,0.142,33,0 765 | 10,101,76,48,180,32.9,0.171,63,0 766 | 2,122,70,27,0,36.8,0.34,27,0 767 | 5,121,72,23,112,26.2,0.245,30,0 768 | 1,126,60,0,0,30.1,0.349,47,1 769 | 1,93,70,31,0,30.4,0.315,23,0 --------------------------------------------------------------------------------