-
Notifications
You must be signed in to change notification settings - Fork 6
/
ML_Models
1 lines (1 loc) · 22.6 KB
/
ML_Models
1
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"ML ","provenance":[],"collapsed_sections":["XpcDf3MCoSc3","Hufw1qB7s_ud","s4qnCnkxzLkT","qGQcU9tqrPjW","N6nduLKd8iFe"]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"code","metadata":{"id":"bWz_VX2xDtoD","colab_type":"code","colab":{}},"source":["import pandas as pd\n","import numpy as np\n","import os\n","import pickle\n","import sys\n","import math\n","from sklearn.metrics import confusion_matrix,classification_report\n","import warnings\n","warnings.simplefilter(action='ignore', category=FutureWarning)\n","from matplot"],"execution_count":0,"outputs":[]},{"cell_type":"code","metadata":{"id":"9yFEQ2okoYwG","colab_type":"code","outputId":"84334b2d-17b8-4373-f76e-ec49af49518b","executionInfo":{"status":"ok","timestamp":1567090574523,"user_tz":-330,"elapsed":1648,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"source":["\n","from google.colab import drive \n","drive.mount (\"/content/gdrive\")"],"execution_count":0,"outputs":[{"output_type":"stream","text":["Drive already mounted at /content/gdrive; to attempt to forcibly remount, call drive.mount(\"/content/gdrive\", force_remount=True).\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"xtza0lkJEABn","colab_type":"code","colab":{}},"source":["os.chdir(\"/content/gdrive/My Drive/Recovery\")"],"execution_count":0,"outputs":[]},{"cell_type":"code","metadata":{"id":"Hi4NxIyMrwwu","colab_type":"code","colab":{}},"source":["def normalize(df):\n"," a = df.drop(columns = ['0'])\n"," for i in a.columns.to_list():\n"," mean = df[i].mean()\n"," std = df[i].std()\n"," df[i] = (df[i]-mean)/std\n"," return df\n","\n","def rfe(model,X_train,y_train):\n"," from sklearn.feature_selection import RFE\n"," selector = RFE(model,60,1,1)\n"," selector.fit(X_train,y_train)\n"," selector.ranking_\n","\n"," y_p = selector.predict(X_test)\n"," print (confusion_matrix(y_test,y_p))\n","\n"," print (classification_report(y_test,y_p,digits = 5))\n"," \n","def getsize(model):\n"," p = pickle.dumps(model)\n"," return sys.getsizeof(p)"],"execution_count":0,"outputs":[]},{"cell_type":"code","metadata":{"id":"tOSdzPM_zS_v","colab_type":"code","colab":{}},"source":["def getfeatures(model,X_train,y_train):\n"," from sklearn.feature_selection import RFE\n"," model = DecisionTreeClassifier()\n"," selector = RFE(model,60,1)\n"," selector.fit(X_train,y_train)\n"," col = []\n"," for i in range(len(selector.ranking_)):\n"," if selector.ranking_[i] == 1:\n"," col.append(X_train.columns[i])\n"," return col\n"," \n"," \n"," "],"execution_count":0,"outputs":[]},{"cell_type":"code","metadata":{"id":"n8KI6fZN2Ogr","colab_type":"code","colab":{}},"source":[""],"execution_count":0,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"y2MRPD_O1s-W","colab_type":"text"},"source":["# Class selection : \n","The preprocessed data from Datapreprocessing.ipynb results in contains 3 classes with 10 features. However, we consider only the FOG and Normal classes modelling the problem as a binary classification problem.\n"]},{"cell_type":"code","metadata":{"id":"KLwMlOMDESyQ","colab_type":"code","outputId":"00d250b3-0cf1-4ff7-8761-3cd1dcfee6cf","executionInfo":{"status":"ok","timestamp":1567090586886,"user_tz":-330,"elapsed":1417,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":162}},"source":["featurePath = os.getcwd()+\"/dataset_fog_release/dataset/features\"\n","\n","windowLength = 1\n","fs = 64\n","\n","readTime = featurePath +\"/time_\" +str(windowLength)+\".csv\"\n","readFreq = featurePath + \"/freq_\"+str(windowLength)+\".csv\"\n","\n","timeDom = pd.read_csv(readTime)\n","freqDom = pd.read_csv(readFreq)\n","\n","print (timeDom.shape,freqDom.shape)\n","\n","df = pd.concat([timeDom,freqDom],axis = 1)\n","\n","print (df['0'].value_counts())\n","\n","df = df[df['0'] != 2]\n","print (df['0'].value_counts())\n","\n","df = normalize(df)"],"execution_count":0,"outputs":[{"output_type":"stream","text":["(14093, 46) (14093, 45)\n","0 12148\n","1 1690\n","2 255\n","Name: 0, dtype: int64\n","0 12148\n","1 1690\n","Name: 0, dtype: int64\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"i9cUkcrLm1fG","colab_type":"text"},"source":["# Train-Test Split.\n","There exists a class imbalance between FOG and Normal classes. This is solved using SMOTE over sampling. Random Undersampling also works with considerable efficiency.\n"]},{"cell_type":"code","metadata":{"id":"jzhy4kQZEhCo","colab_type":"code","outputId":"d97d3d6c-e22c-4969-b8e6-a5995f2ecc6a","executionInfo":{"status":"ok","timestamp":1567090587675,"user_tz":-330,"elapsed":1348,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":53}},"source":["from sklearn.model_selection import train_test_split\n","from sklearn.model_selection import cross_val_score\n","from imblearn.over_sampling import SMOTE\n","X = df.drop(columns = [\"0\"])\n","y = df['0']\n","\n","X_resampled, y_resampled = SMOTE().fit_resample(X,y)\n","\n","print (X_resampled.shape,y_resampled.shape)\n","\n","X_train,X_test,y_train,y_test = train_test_split(X_resampled,y_resampled, train_size = 0.7, stratify = y_resampled)\n","\n","print (X_train.shape,X_test.shape,y_train.shape,y_test.shape)\n"],"execution_count":0,"outputs":[{"output_type":"stream","text":["(24296, 90) (24296,)\n","(17007, 90) (7289, 90) (17007,) (7289,)\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"23l6VinmnT6R","colab_type":"text"},"source":["# Standard ML Model Experiments:\n","The tests are conducted under various standard ML models and thier corresponding efficiencies and model sizes are reported."]},{"cell_type":"markdown","metadata":{"id":"XpcDf3MCoSc3","colab_type":"text"},"source":["#PrunedDecisiontrees"]},{"cell_type":"code","metadata":{"id":"zNrf43emFk7K","colab_type":"code","outputId":"3db2f902-0fef-41af-89ff-3f11e84ad14e","executionInfo":{"status":"ok","timestamp":1567091461466,"user_tz":-330,"elapsed":23101,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":1000}},"source":["from sklearn.tree import DecisionTreeClassifier\n"," \n","# X_train = X_train[getfeatures(model,X_train,y_train)]\n","# X_test = X_test[getfeatures(model,X_train,y_train)]\n","for i in range(1,25,2): \n"," model = DecisionTreeClassifier(max_depth=i)\n"," model.fit(X_train,y_train)\n"," y_pred = model.predict(X_test)\n","\n"," # scores = cross_val_score(model,X_resampled,y_resampled,cv=10)\n"," # print(\"Accuracy: %0.5f (+/- %0.5f)\" % (scores.mean(), scores.std() * 2))\n"," # print (confusion_matrix(y_test,y_pred))\n","\n"," print (classification_report(y_test,y_pred,digits=5))\n"," print (\"Model size is: \",getsize(model),\"bytes\")"],"execution_count":0,"outputs":[{"output_type":"stream","text":[" precision recall f1-score support\n","\n"," 0 0.93329 0.40302 0.56294 3645\n"," 1 0.61925 0.97119 0.75628 3644\n","\n"," accuracy 0.68706 7289\n"," macro avg 0.77627 0.68710 0.65961 7289\n","weighted avg 0.77629 0.68706 0.65960 7289\n","\n","Model size is: 1488 bytes\n"," precision recall f1-score support\n","\n"," 0 0.90966 0.63539 0.74818 3645\n"," 1 0.71980 0.93688 0.81412 3644\n","\n"," accuracy 0.78612 7289\n"," macro avg 0.81473 0.78614 0.78115 7289\n","weighted avg 0.81474 0.78612 0.78115 7289\n","\n","Model size is: 2355 bytes\n"," precision recall f1-score support\n","\n"," 0 0.92479 0.77586 0.84380 3645\n"," 1 0.80690 0.93688 0.86705 3644\n","\n"," accuracy 0.85636 7289\n"," macro avg 0.86584 0.85637 0.85542 7289\n","weighted avg 0.86585 0.85636 0.85542 7289\n","\n","Model size is: 5094 bytes\n"," precision recall f1-score support\n","\n"," 0 0.94234 0.83402 0.88488 3645\n"," 1 0.85110 0.94896 0.89737 3644\n","\n"," accuracy 0.89148 7289\n"," macro avg 0.89672 0.89149 0.89112 7289\n","weighted avg 0.89673 0.89148 0.89112 7289\n","\n","Model size is: 12582 bytes\n"," precision recall f1-score support\n","\n"," 0 0.95478 0.86310 0.90663 3645\n"," 1 0.87506 0.95911 0.91516 3644\n","\n"," accuracy 0.91110 7289\n"," macro avg 0.91492 0.91111 0.91089 7289\n","weighted avg 0.91493 0.91110 0.91089 7289\n","\n","Model size is: 26553 bytes\n"," precision recall f1-score support\n","\n"," 0 0.96235 0.87654 0.91744 3645\n"," 1 0.88662 0.96570 0.92447 3644\n","\n"," accuracy 0.92111 7289\n"," macro avg 0.92449 0.92112 0.92096 7289\n","weighted avg 0.92449 0.92111 0.92096 7289\n","\n","Model size is: 42537 bytes\n"," precision recall f1-score support\n","\n"," 0 0.96650 0.88642 0.92473 3645\n"," 1 0.89508 0.96926 0.93070 3644\n","\n"," accuracy 0.92784 7289\n"," macro avg 0.93079 0.92784 0.92771 7289\n","weighted avg 0.93080 0.92784 0.92771 7289\n","\n","Model size is: 51753 bytes\n"," precision recall f1-score support\n","\n"," 0 0.95853 0.89410 0.92520 3645\n"," 1 0.90075 0.96131 0.93004 3644\n","\n"," accuracy 0.92770 7289\n"," macro avg 0.92964 0.92770 0.92762 7289\n","weighted avg 0.92964 0.92770 0.92762 7289\n","\n","Model size is: 58809 bytes\n"," precision recall f1-score support\n","\n"," 0 0.96234 0.89739 0.92873 3645\n"," 1 0.90386 0.96487 0.93337 3644\n","\n"," accuracy 0.93113 7289\n"," macro avg 0.93310 0.93113 0.93105 7289\n","weighted avg 0.93310 0.93113 0.93105 7289\n","\n","Model size is: 64137 bytes\n"," precision recall f1-score support\n","\n"," 0 0.95270 0.90069 0.92596 3645\n"," 1 0.90580 0.95527 0.92988 3644\n","\n"," accuracy 0.92797 7289\n"," macro avg 0.92925 0.92798 0.92792 7289\n","weighted avg 0.92925 0.92797 0.92792 7289\n","\n","Model size is: 69033 bytes\n"," precision recall f1-score support\n","\n"," 0 0.95440 0.90727 0.93024 3645\n"," 1 0.91161 0.95664 0.93358 3644\n","\n"," accuracy 0.93195 7289\n"," macro avg 0.93301 0.93196 0.93191 7289\n","weighted avg 0.93301 0.93195 0.93191 7289\n","\n","Model size is: 74217 bytes\n"," precision recall f1-score support\n","\n"," 0 0.95082 0.90178 0.92565 3645\n"," 1 0.90658 0.95335 0.92937 3644\n","\n"," accuracy 0.92756 7289\n"," macro avg 0.92870 0.92757 0.92751 7289\n","weighted avg 0.92870 0.92756 0.92751 7289\n","\n","Model size is: 77673 bytes\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"_k3acLrVtG0w","colab_type":"code","colab":{}},"source":["# rfe(model,X_train,y_train)\n","# print (\"Model size is: \",getsize(model),\"bytes\")"],"execution_count":0,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"Hufw1qB7s_ud","colab_type":"text"},"source":["# Random Forest\n"]},{"cell_type":"code","metadata":{"id":"WK1PoenFpG-a","colab_type":"code","outputId":"f56f74cc-4ee6-4187-d925-41dc8815431e","executionInfo":{"status":"ok","timestamp":1567091063239,"user_tz":-330,"elapsed":14439,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":1000}},"source":["from sklearn.ensemble import RandomForestClassifier\n","from sklearn.metrics import recall_score\n","for i in range(1,25,2):\n"," model = RandomForestClassifier(max_depth=i)\n"," model.fit(X_train,y_train)\n"," y_pred = model.predict(X_test)\n","\n","# scores = cross_val_score(model,X_resampled,y_resampled,cv=10)\n","# print(\"Accuracy: %0.5f (+/- %0.5f)\" % (scores.mean(), scores.std() * 2))\n"," # print (confusion_matrix(y_test,y_pred))\n"," print (\"depth = %d\",i)\n"," print (classification_report(y_test,y_pred,digits=5))\n"," # print (recall_score(y_test,y_pred))\n"," print (\"Model size is: \",getsize(model),\"bytes\")"],"execution_count":0,"outputs":[{"output_type":"stream","text":["depth = %d 1\n"," precision recall f1-score support\n","\n"," 0 0.88729 0.45569 0.60214 3645\n"," 1 0.63375 0.94210 0.75775 3644\n","\n"," accuracy 0.69886 7289\n"," macro avg 0.76052 0.69889 0.67995 7289\n","weighted avg 0.76053 0.69886 0.67994 7289\n","\n","Model size is: 7283 bytes\n","depth = %d 3\n"," precision recall f1-score support\n","\n"," 0 0.88850 0.75638 0.81713 3645\n"," 1 0.78786 0.90505 0.84240 3644\n","\n"," accuracy 0.83070 7289\n"," macro avg 0.83818 0.83071 0.82977 7289\n","weighted avg 0.83819 0.83070 0.82976 7289\n","\n","Model size is: 15809 bytes\n","depth = %d 5\n"," precision recall f1-score support\n","\n"," 0 0.93290 0.78189 0.85075 3645\n"," 1 0.81223 0.94374 0.87306 3644\n","\n"," accuracy 0.86281 7289\n"," macro avg 0.87257 0.86282 0.86191 7289\n","weighted avg 0.87257 0.86281 0.86190 7289\n","\n","Model size is: 44495 bytes\n","depth = %d 7\n"," precision recall f1-score support\n","\n"," 0 0.96591 0.83951 0.89828 3645\n"," 1 0.85804 0.97036 0.91075 3644\n","\n"," accuracy 0.90493 7289\n"," macro avg 0.91198 0.90493 0.90452 7289\n","weighted avg 0.91198 0.90493 0.90452 7289\n","\n","Model size is: 124415 bytes\n","depth = %d 9\n"," precision recall f1-score support\n","\n"," 0 0.97363 0.85103 0.90821 3645\n"," 1 0.86766 0.97695 0.91907 3644\n","\n"," accuracy 0.91398 7289\n"," macro avg 0.92065 0.91399 0.91364 7289\n","weighted avg 0.92065 0.91398 0.91364 7289\n","\n","Model size is: 223658 bytes\n","depth = %d 11\n"," precision recall f1-score support\n","\n"," 0 0.98249 0.89273 0.93546 3645\n"," 1 0.90168 0.98408 0.94108 3644\n","\n"," accuracy 0.93840 7289\n"," macro avg 0.94209 0.93841 0.93827 7289\n","weighted avg 0.94209 0.93840 0.93827 7289\n","\n","Model size is: 383213 bytes\n","depth = %d 13\n"," precision recall f1-score support\n","\n"," 0 0.98514 0.90919 0.94564 3645\n"," 1 0.91567 0.98628 0.94966 3644\n","\n"," accuracy 0.94773 7289\n"," macro avg 0.95040 0.94773 0.94765 7289\n","weighted avg 0.95041 0.94773 0.94765 7289\n","\n","Model size is: 545501 bytes\n","depth = %d 15\n"," precision recall f1-score support\n","\n"," 0 0.98553 0.91550 0.94922 3645\n"," 1 0.92109 0.98655 0.95270 3644\n","\n"," accuracy 0.95102 7289\n"," macro avg 0.95331 0.95103 0.95096 7289\n","weighted avg 0.95331 0.95102 0.95096 7289\n","\n","Model size is: 669917 bytes\n","depth = %d 17\n"," precision recall f1-score support\n","\n"," 0 0.98055 0.92647 0.95274 3645\n"," 1 0.93030 0.98161 0.95527 3644\n","\n"," accuracy 0.95404 7289\n"," macro avg 0.95542 0.95404 0.95401 7289\n","weighted avg 0.95543 0.95404 0.95401 7289\n","\n","Model size is: 716429 bytes\n","depth = %d 19\n"," precision recall f1-score support\n","\n"," 0 0.97949 0.93004 0.95412 3645\n"," 1 0.93339 0.98052 0.95637 3644\n","\n"," accuracy 0.95528 7289\n"," macro avg 0.95644 0.95528 0.95525 7289\n","weighted avg 0.95644 0.95528 0.95525 7289\n","\n","Model size is: 751421 bytes\n","depth = %d 21\n"," precision recall f1-score support\n","\n"," 0 0.97723 0.94184 0.95921 3645\n"," 1 0.94386 0.97805 0.96065 3644\n","\n"," accuracy 0.95994 7289\n"," macro avg 0.96054 0.95994 0.95993 7289\n","weighted avg 0.96054 0.95994 0.95993 7289\n","\n","Model size is: 844301 bytes\n","depth = %d 23\n"," precision recall f1-score support\n","\n"," 0 0.98061 0.94348 0.96169 3645\n"," 1 0.94553 0.98134 0.96310 3644\n","\n"," accuracy 0.96241 7289\n"," macro avg 0.96307 0.96241 0.96240 7289\n","weighted avg 0.96307 0.96241 0.96240 7289\n","\n","Model size is: 874541 bytes\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"DFeZMj-7ysMz","colab_type":"code","outputId":"f4baa2cf-dd67-4367-8ba1-c661f67aed13","executionInfo":{"status":"ok","timestamp":1567090634821,"user_tz":-330,"elapsed":715,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":35}},"source":["# rfe(model,X_train,y_train)\n"],"execution_count":0,"outputs":[{"output_type":"stream","text":["Model size is: 7283 bytes\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"s4qnCnkxzLkT","colab_type":"text"},"source":["#SVM - RBF"]},{"cell_type":"code","metadata":{"id":"GvxjXLrqq7ih","colab_type":"code","outputId":"e3089600-8598-4ee0-f6ac-6e81b38f1ad1","executionInfo":{"status":"ok","timestamp":1567074932634,"user_tz":-330,"elapsed":256628,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":253}},"source":["from sklearn.svm import SVC\n","\n","# X_train = X_train[getfeatures(X_train,y_train)]\n","# X_test = X_test[getfeatures(X_train,y_train)]\n","\n","model = SVC(kernel='rbf')\n","model.fit(X_train,y_train)\n","y_pred = model.predict(X_test)\n","scores = cross_val_score(model,X_train,y_train,cv=10)\n","print(\"Accuracy: %0.5f (+/- %0.5f)\" % (scores.mean(), scores.std() * 2))\n","print (confusion_matrix(y_test,y_pred))\n","print (classification_report(y_test,y_pred,digits=5))\n","print (\"Model size is: \",getsize(model),\"bytes\")\n","\n","# rfe(model)"],"execution_count":0,"outputs":[{"output_type":"stream","text":["Accuracy: 0.90998 (+/- 0.01520)\n","[[3243 401]\n"," [ 195 3450]]\n"," precision recall f1-score support\n","\n"," 0 0.94328 0.88996 0.91584 3644\n"," 1 0.89587 0.94650 0.92049 3645\n","\n"," accuracy 0.91823 7289\n"," macro avg 0.91958 0.91823 0.91817 7289\n","weighted avg 0.91957 0.91823 0.91817 7289\n","\n","Model size is: 3973711 bytes\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"qGQcU9tqrPjW","colab_type":"text"},"source":["# KNN\n"]},{"cell_type":"code","metadata":{"id":"WQqlrKdgtE2h","colab_type":"code","outputId":"59a4f55a-95a4-4553-9136-37825e8edeb0","executionInfo":{"status":"ok","timestamp":1567074946265,"user_tz":-330,"elapsed":269246,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":235}},"source":["from sklearn.neighbors import KNeighborsClassifier\n","\n","# X_train = X_train[getfeatures(X_train,y_train)]\n","# X_test = X_test[getfeatures(X_train,y_train)]\n","\n","model = KNeighborsClassifier()\n","model.fit(X_train,y_train)\n","y_pred = model.predict(X_test)\n","\n","print (confusion_matrix(y_test,y_pred))\n","\n","print (classification_report(y_test,y_pred,digits=5))\n","\n","print (\"Model size is: \",getsize(model),'bytes')\n","# rfe(model)"],"execution_count":0,"outputs":[{"output_type":"stream","text":["[[3137 507]\n"," [ 12 3633]]\n"," precision recall f1-score support\n","\n"," 0 0.99619 0.86087 0.92360 3644\n"," 1 0.87754 0.99671 0.93333 3645\n","\n"," accuracy 0.92880 7289\n"," macro avg 0.93686 0.92879 0.92847 7289\n","weighted avg 0.93685 0.92880 0.92847 7289\n","\n","Model size is: 14024367 bytes\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"N6nduLKd8iFe","colab_type":"text"},"source":["# Adaboost\n"]},{"cell_type":"code","metadata":{"id":"EBtNPozl3ZsM","colab_type":"code","outputId":"0c1e3268-4cac-4bd0-f7d9-0fdcdd322841","executionInfo":{"status":"ok","timestamp":1567074948093,"user_tz":-330,"elapsed":270080,"user":{"displayName":"Gokul Hari","photoUrl":"","userId":"16159457985484250305"}},"colab":{"base_uri":"https://localhost:8080/","height":235}},"source":["from sklearn.ensemble import AdaBoostClassifier\n","\n","model = RandomForestClassifier()\n","model.fit(X_train,y_train)\n","y_pred = model.predict(X_test)\n","\n","print (confusion_matrix(y_test,y_pred))\n","\n","print (classification_report(y_test,y_pred,digits=5))\n","\n","\n","# rfe(model,X_train,y_train)\n","\n","print (\"Model size is: \",getsize(model),'bytes')\n"],"execution_count":0,"outputs":[{"output_type":"stream","text":["[[3463 181]\n"," [ 89 3556]]\n"," precision recall f1-score support\n","\n"," 0 0.97494 0.95033 0.96248 3644\n"," 1 0.95157 0.97558 0.96342 3645\n","\n"," accuracy 0.96296 7289\n"," macro avg 0.96325 0.96296 0.96295 7289\n","weighted avg 0.96325 0.96296 0.96295 7289\n","\n","Model size is: 1053522 bytes\n"],"name":"stdout"}]}]}