{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Importing necessary libraries**","metadata":{}},{"cell_type":"code","source":"# For data manipulation and visualization\nimport numpy as np\nimport pandas as pd\n# import data plotting\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# For predictive data analysis\nfrom sklearn.preprocessing import OneHotEncoder, LabelEncoder\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.neighbors import KNeighborsClassifier\nimport sklearn.svm\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import confusion_matrix, accuracy_score, precision_recall_curve ","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Reading from the dataset**","metadata":{}},{"cell_type":"code","source":"tr = pd.read_csv(r\"../input/titanic/train.csv\")#reading training dataset\nte = pd.read_csv(r\"../input/titanic/test.csv\")#reading test dataset","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"(tr.shape,te.shape)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **EXPLORATORY DATA ANALYSIS(EDA)**","metadata":{}},{"cell_type":"markdown","source":"# **Collecting information about data set**","metadata":{}},{"cell_type":"code","source":"tr.info()#collecting information training dataset","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tr.describe()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"te.info()#collecting information test dataset","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"te.describe","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Checking for duplicates**","metadata":{}},{"cell_type":"code","source":"tr.duplicated().sum()#checking for duplicates in training dataset","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"te.duplicated().sum()#checking for duplicates in test dataset","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Checking for null values**","metadata":{}},{"cell_type":"code","source":"tr.isnull().sum()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"te.isnull().sum()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Missing Percentage of Values**","metadata":{}},{"cell_type":"code","source":"def missing (tr):\n    missing_no = tr.isnull().sum().sort_values()\n    missing_percent = ((tr.isnull().sum()/tr.isnull().count())*100).sort_values(ascending=False)\n    missing_values = pd.concat([missing_no, missing_percent], axis=1, keys=['missing_Number', 'missing_Percent'])\n    return missing_values","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"missing(tr)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"missing(te)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# ****Filling null values with mean,median,mode****","metadata":{}},{"cell_type":"code","source":"#fill null values with mean,median ,mode\ntr['Age']=tr['Age'].fillna(tr['Age'].mean())\ntr['Embarked']=tr['Embarked'].fillna(tr['Embarked'].mode())\nprint(tr)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#fill null values with mean,median ,mode\nte['Age']=te['Age'].fillna(te['Age'].mean())\nte['Embarked']=te['Embarked'].fillna(te['Embarked'].mode())\nprint(te)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Encoding values**","metadata":{}},{"cell_type":"code","source":"sexDict = {'male': 0, 'female': 1}\ntr.Sex = [sexDict[item] for item in tr.Sex]\ntr.head()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **DATA VISUALIZATION**","metadata":{}},{"cell_type":"markdown","source":"# **Correlation between our target variable and different parameters**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(12,8))\ndata = tr.corr()[\"Survived\"].sort_values(ascending=False)\nindices = data.index\nlabels = []\ncorr = []\nfor i in range(1, len(indices)):\n    labels.append(indices[i])\n    corr.append(data[i])\nsns.barplot(x=corr, y=labels, palette='viridis')\nplt.title('Correlation coefficient between different features and Label')\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"As noticed pclass,sex and fare are the most impactful parameters","metadata":{}},{"cell_type":"markdown","source":"# **Distribution of important parameters**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(20,8))\nsns.histplot(tr.Pclass, color=sns.color_palette('Blues_d')[2])\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,8))\nsns.histplot(train.Sex, color=sns.color_palette('crest')[2])\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,10))\nsns.histplot(train.Fare, color=sns.color_palette('magma')[2])\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Comparison of different parameters with Survived label**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize = (10, 10))\nsns.countplot(x = \"Pclass\", hue = \"Survived\", data = tr)\nplt.title(\"Survived VS Pclass\")\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize = (10, 10))\nsns.countplot(x = \"Sex\", hue = \"Survived\", data = tr)\nplt.title(\"Survived VS Sex\")\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize = (10, 10))\nsns.countplot(x = \"SibSp\", hue = \"Survived\", data = tr)\nplt.title(\"Survived VS SibSp\")\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize = (10, 10))\nsns.countplot(x = \"Age\", hue = \"Survived\", data = tr)\nplt.title(\"Survived VS Age\")\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize = (10, 10))\nsns.countplot(x = \"Fare\", hue = \"Survived\", data = tr)\nplt.title(\"Survived VS Fare\")\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize = (10, 10))\nsns.countplot(x = \"Parch\", hue = \"Survived\", data = tr)\nplt.title(\"Survived VS Parch\")\nplt.show()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **DATA PREPROCESSING**","metadata":{}},{"cell_type":"code","source":"X=tr.drop(['Survived','Name','Ticket','Cabin','Embarked'], axis=1)\ny=tr['Survived']","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Splitting into training and test data**","metadata":{}},{"cell_type":"code","source":"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2)\nX_train.shape, X_test.shape, y_train.shape, y_test.shape","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:13:59.080219Z","iopub.execute_input":"2022-07-21T16:13:59.080730Z","iopub.status.idle":"2022-07-21T16:13:59.093044Z","shell.execute_reply.started":"2022-07-21T16:13:59.080690Z","shell.execute_reply":"2022-07-21T16:13:59.092118Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **BUILDING AND CLASSIFYING MODELS**","metadata":{}},{"cell_type":"code","source":"decision_tree_model = DecisionTreeClassifier()\ndecision_tree_model.fit(X_train, y_train)\ndecision_tree_model.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:04.414966Z","iopub.execute_input":"2022-07-21T16:14:04.415398Z","iopub.status.idle":"2022-07-21T16:14:04.436581Z","shell.execute_reply.started":"2022-07-21T16:14:04.415365Z","shell.execute_reply":"2022-07-21T16:14:04.434928Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"random_forest_model = RandomForestClassifier()\nrandom_forest_model.fit(X_train, y_train)\nrandom_forest_model.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:07.105403Z","iopub.execute_input":"2022-07-21T16:14:07.106729Z","iopub.status.idle":"2022-07-21T16:14:07.445207Z","shell.execute_reply.started":"2022-07-21T16:14:07.106659Z","shell.execute_reply":"2022-07-21T16:14:07.443191Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"NB_model = GaussianNB()\nNB_model.fit(X_train, y_train)\nNB_model.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:09.375229Z","iopub.execute_input":"2022-07-21T16:14:09.375714Z","iopub.status.idle":"2022-07-21T16:14:09.394771Z","shell.execute_reply.started":"2022-07-21T16:14:09.375679Z","shell.execute_reply":"2022-07-21T16:14:09.393280Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"knn_model = KNeighborsClassifier(n_neighbors = 5)\nknn_model.fit(X_train, y_train)\nknn_model.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:13.975693Z","iopub.execute_input":"2022-07-21T16:14:13.976932Z","iopub.status.idle":"2022-07-21T16:14:14.021670Z","shell.execute_reply.started":"2022-07-21T16:14:13.976884Z","shell.execute_reply":"2022-07-21T16:14:14.020092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"svmLinearModel=sklearn.svm.SVC(kernel='linear',C=10)\nsvmLinearModel.fit(X_train, y_train)\nsvmLinearModel.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:15.930584Z","iopub.execute_input":"2022-07-21T16:14:15.931253Z","iopub.status.idle":"2022-07-21T16:14:37.489915Z","shell.execute_reply.started":"2022-07-21T16:14:15.931215Z","shell.execute_reply":"2022-07-21T16:14:37.489015Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"svmRbfModel=sklearn.svm.SVC(kernel='rbf',C=10)\nsvmRbfModel.fit(X_train, y_train)\nsvmRbfModel.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:40.000566Z","iopub.execute_input":"2022-07-21T16:14:40.001061Z","iopub.status.idle":"2022-07-21T16:14:40.059790Z","shell.execute_reply.started":"2022-07-21T16:14:40.001024Z","shell.execute_reply":"2022-07-21T16:14:40.058347Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"svmPolyModel=sklearn.svm.SVC(kernel='poly',C=10000)\nsvmPolyModel.fit(X_train, y_train)\nsvmPolyModel.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:42.345071Z","iopub.execute_input":"2022-07-21T16:14:42.346296Z","iopub.status.idle":"2022-07-21T16:14:53.334083Z","shell.execute_reply.started":"2022-07-21T16:14:42.346248Z","shell.execute_reply":"2022-07-21T16:14:53.332665Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"regressionModel = LogisticRegression(solver='liblinear')\nregressionModel.fit(X_train, y_train)\nregressionModel.score(X_train, y_train)","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:14:56.245072Z","iopub.execute_input":"2022-07-21T16:14:56.245523Z","iopub.status.idle":"2022-07-21T16:14:56.264198Z","shell.execute_reply.started":"2022-07-21T16:14:56.245489Z","shell.execute_reply":"2022-07-21T16:14:56.262938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **PERFORMANCE ANALYSIS OF MODELS**","metadata":{}},{"cell_type":"code","source":"trainScores = [regressionModel.score(X_train, y_train), knn_model.score(X_train, y_train),NB_model.score(X_train, y_train), svmLinearModel.score(X_train, y_train), svmRbfModel.score(X_train, y_train),svmPolyModel.score(X_train, y_train),random_forest_model.score(X_train, y_train),decision_tree_model.score(X_train, y_train)]\ntestScores = [regressionModel.score(X_test, y_test), knn_model.score(X_test, y_test), NB_model.score(X_test, y_test),svmLinearModel.score(X_test, y_test), svmRbfModel.score(X_test, y_test),svmPolyModel.score(X_test, y_test),random_forest_model.score(X_test, y_test),decision_tree_model.score(X_test, y_test)]\nindices = ['Logistic Regression', 'KNN','NB_model','SVM-Linear', 'SVM-RBF','SVM-Poly', 'RandomForest', 'DecisionTree']\nscores = pd.DataFrame({'Training Score': trainScores,'Testing Score': testScores}, index=indices)\nplot = scores.plot.bar(figsize=(16, 8), rot=0)\nplt.title('Training and Testing Scores')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:15:01.275431Z","iopub.execute_input":"2022-07-21T16:15:01.275954Z","iopub.status.idle":"2022-07-21T16:15:01.709302Z","shell.execute_reply.started":"2022-07-21T16:15:01.275913Z","shell.execute_reply":"2022-07-21T16:15:01.708075Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scores","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:15:07.606210Z","iopub.execute_input":"2022-07-21T16:15:07.607270Z","iopub.status.idle":"2022-07-21T16:15:07.623366Z","shell.execute_reply.started":"2022-07-21T16:15:07.607228Z","shell.execute_reply":"2022-07-21T16:15:07.621561Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Prediction done by the models**","metadata":{}},{"cell_type":"code","source":"predRegression = regressionModel.predict(X_test)\npredSVMLinear = svmLinearModel.predict(X_test)\npredSVMRbf = svmRbfModel.predict(X_test)\npredKNN = knn_model.predict(X_test)\npredSVMPoly = svmPolyModel.predict(X_test)\npredRandomF = random_forest_model.predict(X_test)\npredDTree = decision_tree_model.predict(X_test)\npredNBC=NB_model.predict(X_test)\npredVals = pd.DataFrame(data={'truth': y_test, 'regression': predRegression, 'knn': predKNN, 'svm-linear': predSVMLinear, 'svm-rbf': predSVMRbf, 'svm-poly': predSVMPoly, 'random-forest': predRandomF, 'decision-tree': predDTree,'Naive Bayes classifier':predNBC})","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:15:13.895625Z","iopub.execute_input":"2022-07-21T16:15:13.897120Z","iopub.status.idle":"2022-07-21T16:15:13.957981Z","shell.execute_reply.started":"2022-07-21T16:15:13.897069Z","shell.execute_reply":"2022-07-21T16:15:13.956194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Confusion matrix**","metadata":{}},{"cell_type":"code","source":"plt.figure(figsize=(16, 14))\nplt.subplot(4, 4, 1)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predRegression), annot=True).set(title='Logistic Regression')\nplt.subplot(4, 4, 2)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predKNN), annot=True).set(title='KNN')\nplt.subplot(4, 4, 3)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predSVMLinear), annot=True).set(title='SVM-Linear')\nplt.subplot(4, 4, 4)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predSVMRbf), annot=True).set(title='SVM-Rbf')\nplt.subplot(4, 4, 5)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predSVMPoly), annot=True).set(title='SVM-Poly')\nplt.subplot(4, 4, 6)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predRandomF), annot=True).set(title='Random Forest')\nplt.subplot(4, 4, 7)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predDTree), annot=True).set(title='Decision Tree')\nplt.subplot(4, 4, 8)\nsns.heatmap(sklearn.metrics.confusion_matrix(y_test, predNBC), annot=True).set(title='Naive Bayes classifier')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:15:18.675238Z","iopub.execute_input":"2022-07-21T16:15:18.675919Z","iopub.status.idle":"2022-07-21T16:15:21.561699Z","shell.execute_reply.started":"2022-07-21T16:15:18.675870Z","shell.execute_reply":"2022-07-21T16:15:21.560177Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **Classification Reports**","metadata":{}},{"cell_type":"code","source":"print(\"Logistic Regression:\\n\\n\", sklearn.metrics.classification_report(y_test, predRegression))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:15:39.862105Z","iopub.execute_input":"2022-07-21T16:15:39.862602Z","iopub.status.idle":"2022-07-21T16:15:39.879801Z","shell.execute_reply.started":"2022-07-21T16:15:39.862564Z","shell.execute_reply":"2022-07-21T16:15:39.878159Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"KNN:\\n\\n\", sklearn.metrics.classification_report(y_test, predKNN))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:16:47.706338Z","iopub.execute_input":"2022-07-21T16:16:47.706935Z","iopub.status.idle":"2022-07-21T16:16:47.722116Z","shell.execute_reply.started":"2022-07-21T16:16:47.706893Z","shell.execute_reply":"2022-07-21T16:16:47.720649Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"SVM with linear kernel:\\n\\n\", sklearn.metrics.classification_report(y_test, predSVMLinear))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:17:01.465804Z","iopub.execute_input":"2022-07-21T16:17:01.466293Z","iopub.status.idle":"2022-07-21T16:17:01.481907Z","shell.execute_reply.started":"2022-07-21T16:17:01.466254Z","shell.execute_reply":"2022-07-21T16:17:01.480286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"SVM with RBF kernel:\\n\\n\", sklearn.metrics.classification_report(y_test, predSVMRbf))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:17:16.100917Z","iopub.execute_input":"2022-07-21T16:17:16.101335Z","iopub.status.idle":"2022-07-21T16:17:16.114419Z","shell.execute_reply.started":"2022-07-21T16:17:16.101303Z","shell.execute_reply":"2022-07-21T16:17:16.112930Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"SVM with poly kernel:\\n\\n\", sklearn.metrics.classification_report(y_test, predSVMPoly))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:17:07.200601Z","iopub.execute_input":"2022-07-21T16:17:07.201994Z","iopub.status.idle":"2022-07-21T16:17:07.214418Z","shell.execute_reply.started":"2022-07-21T16:17:07.201941Z","shell.execute_reply":"2022-07-21T16:17:07.212891Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"Random Forest:\\n\\n\", sklearn.metrics.classification_report(y_test, predRandomF))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:17:09.959896Z","iopub.execute_input":"2022-07-21T16:17:09.960332Z","iopub.status.idle":"2022-07-21T16:17:09.976071Z","shell.execute_reply.started":"2022-07-21T16:17:09.960298Z","shell.execute_reply":"2022-07-21T16:17:09.973862Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"Decision Tree:\\n\\n\", sklearn.metrics.classification_report(y_test, predDTree))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:17:25.336034Z","iopub.execute_input":"2022-07-21T16:17:25.336501Z","iopub.status.idle":"2022-07-21T16:17:25.350848Z","shell.execute_reply.started":"2022-07-21T16:17:25.336450Z","shell.execute_reply":"2022-07-21T16:17:25.349433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"Naive Bayes classifier:\\n\\n\", sklearn.metrics.classification_report(y_test,predNBC))","metadata":{"execution":{"iopub.status.busy":"2022-07-21T16:17:30.839989Z","iopub.execute_input":"2022-07-21T16:17:30.840433Z","iopub.status.idle":"2022-07-21T16:17:30.854451Z","shell.execute_reply.started":"2022-07-21T16:17:30.840401Z","shell.execute_reply":"2022-07-21T16:17:30.853138Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv('submission.csv', index = False)","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# **THANK YOU**\n# **YOUR FEEDBACKS WILL BE QUITE HELPFUL**","metadata":{}}]}