From 7b74176a0bb63a2b1d144c1c76535e62c465f245 Mon Sep 17 00:00:00 2001 From: sakeeb hasan <100307524+Sakeebhasan123456@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:31:07 +0530 Subject: [PATCH 1/3] Delete Deep_Learning/Spam Vs Ham Mail Classification [With Streamlit GUI]/Model/model1.ipynb --- .../Model/model1.ipynb | 1461 ----------------- 1 file changed, 1461 deletions(-) delete mode 100644 Deep_Learning/Spam Vs Ham Mail Classification [With Streamlit GUI]/Model/model1.ipynb diff --git a/Deep_Learning/Spam Vs Ham Mail Classification [With Streamlit GUI]/Model/model1.ipynb b/Deep_Learning/Spam Vs Ham Mail Classification [With Streamlit GUI]/Model/model1.ipynb deleted file mode 100644 index 5d41673919..0000000000 --- a/Deep_Learning/Spam Vs Ham Mail Classification [With Streamlit GUI]/Model/model1.ipynb +++ /dev/null @@ -1,1461 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "import seaborn as sns" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - " | Text | \n", - "Label | \n", - "
---|---|---|
0 | \n", - "Go until jurong point, crazy.. Available only ... | \n", - "ham | \n", - "
1 | \n", - "Ok lar... Joking wif u oni... | \n", - "ham | \n", - "
2 | \n", - "Free entry in 2 a wkly comp to win FA Cup fina... | \n", - "spam | \n", - "
3 | \n", - "U dun say so early hor... U c already then say... | \n", - "ham | \n", - "
4 | \n", - "Nah I don't think he goes to usf, he lives aro... | \n", - "ham | \n", - "
\n", - " | Text | \n", - "Label | \n", - "
---|---|---|
0 | \n", - "Go until jurong point, crazy.. Available only ... | \n", - "0 | \n", - "
1 | \n", - "Ok lar... Joking wif u oni... | \n", - "0 | \n", - "
2 | \n", - "Free entry in 2 a wkly comp to win FA Cup fina... | \n", - "1 | \n", - "
3 | \n", - "U dun say so early hor... U c already then say... | \n", - "0 | \n", - "
4 | \n", - "Nah I don't think he goes to usf, he lives aro... | \n", - "0 | \n", - "
\n", - " | Text | \n", - "Label | \n", - "num_chr | \n", - "num_words | \n", - "num_sent | \n", - "
---|---|---|---|---|---|
4755 | \n", - "Ok lor... Or u wan me go look 4 u? | \n", - "0 | \n", - "34 | \n", - "12 | \n", - "1 | \n", - "
5435 | \n", - "You're gonna have to be way more specific than... | \n", - "0 | \n", - "51 | \n", - "12 | \n", - "1 | \n", - "
1299 | \n", - "Your daily text from me â a favour this time | \n", - "0 | \n", - "46 | \n", - "10 | \n", - "1 | \n", - "
2254 | \n", - "Lol enjoy role playing much? | \n", - "0 | \n", - "28 | \n", - "6 | \n", - "1 | \n", - "
998 | \n", - "Not a lot has happened here. Feels very quiet.... | \n", - "0 | \n", - "148 | \n", - "36 | \n", - "5 | \n", - "
\n", - " | Label | \n", - "num_chr | \n", - "num_words | \n", - "num_sent | \n", - "
---|---|---|---|---|
count | \n", - "5171.000000 | \n", - "5171.000000 | \n", - "5171.000000 | \n", - "5171.000000 | \n", - "
mean | \n", - "0.126281 | \n", - "79.457552 | \n", - "18.590988 | \n", - "1.973893 | \n", - "
std | \n", - "0.332198 | \n", - "58.401504 | \n", - "13.383728 | \n", - "1.458880 | \n", - "
min | \n", - "0.000000 | \n", - "2.000000 | \n", - "1.000000 | \n", - "1.000000 | \n", - "
25% | \n", - "0.000000 | \n", - "36.000000 | \n", - "9.000000 | \n", - "1.000000 | \n", - "
50% | \n", - "0.000000 | \n", - "61.000000 | \n", - "15.000000 | \n", - "1.000000 | \n", - "
75% | \n", - "0.000000 | \n", - "119.000000 | \n", - "26.000000 | \n", - "2.000000 | \n", - "
max | \n", - "1.000000 | \n", - "910.000000 | \n", - "220.000000 | \n", - "38.000000 | \n", - "
\n", - " | num_chr | \n", - "num_words | \n", - "num_sent | \n", - "
---|---|---|---|
count | \n", - "5171.000000 | \n", - "5171.000000 | \n", - "5171.000000 | \n", - "
mean | \n", - "79.457552 | \n", - "18.590988 | \n", - "1.973893 | \n", - "
std | \n", - "58.401504 | \n", - "13.383728 | \n", - "1.458880 | \n", - "
min | \n", - "2.000000 | \n", - "1.000000 | \n", - "1.000000 | \n", - "
25% | \n", - "36.000000 | \n", - "9.000000 | \n", - "1.000000 | \n", - "
50% | \n", - "61.000000 | \n", - "15.000000 | \n", - "1.000000 | \n", - "
75% | \n", - "119.000000 | \n", - "26.000000 | \n", - "2.000000 | \n", - "
max | \n", - "910.000000 | \n", - "220.000000 | \n", - "38.000000 | \n", - "
\n", - " | num_chr | \n", - "num_words | \n", - "num_sent | \n", - "
---|---|---|---|
count | \n", - "4518.000000 | \n", - "4518.000000 | \n", - "4518.000000 | \n", - "
mean | \n", - "70.976538 | \n", - "17.265162 | \n", - "1.827579 | \n", - "
std | \n", - "56.610538 | \n", - "13.566409 | \n", - "1.394245 | \n", - "
min | \n", - "2.000000 | \n", - "1.000000 | \n", - "1.000000 | \n", - "
25% | \n", - "34.000000 | \n", - "8.000000 | \n", - "1.000000 | \n", - "
50% | \n", - "53.000000 | \n", - "13.000000 | \n", - "1.000000 | \n", - "
75% | \n", - "91.000000 | \n", - "22.000000 | \n", - "2.000000 | \n", - "
max | \n", - "910.000000 | \n", - "220.000000 | \n", - "38.000000 | \n", - "
\n", - " | num_chr | \n", - "num_words | \n", - "num_sent | \n", - "
---|---|---|---|
count | \n", - "653.000000 | \n", - "653.000000 | \n", - "653.000000 | \n", - "
mean | \n", - "138.136294 | \n", - "27.764165 | \n", - "2.986217 | \n", - "
std | \n", - "29.934972 | \n", - "6.988123 | \n", - "1.494815 | \n", - "
min | \n", - "13.000000 | \n", - "2.000000 | \n", - "1.000000 | \n", - "
25% | \n", - "132.000000 | \n", - "25.000000 | \n", - "2.000000 | \n", - "
50% | \n", - "149.000000 | \n", - "29.000000 | \n", - "3.000000 | \n", - "
75% | \n", - "157.000000 | \n", - "32.000000 | \n", - "4.000000 | \n", - "
max | \n", - "224.000000 | \n", - "46.000000 | \n", - "9.000000 | \n", - "
\n", - " | Text | \n", - "Label | \n", - "num_chr | \n", - "num_words | \n", - "num_sent | \n", - "Transformer_text | \n", - "
---|---|---|---|---|---|---|
0 | \n", - "Go until jurong point, crazy.. Available only ... | \n", - "0 | \n", - "111 | \n", - "24 | \n", - "2 | \n", - "go jurong point crazy available bugis n great ... | \n", - "
1 | \n", - "Ok lar... Joking wif u oni... | \n", - "0 | \n", - "29 | \n", - "8 | \n", - "2 | \n", - "ok lar joking wif u oni | \n", - "
2 | \n", - "Free entry in 2 a wkly comp to win FA Cup fina... | \n", - "1 | \n", - "155 | \n", - "37 | \n", - "2 | \n", - "free entry 2 wkly comp win fa cup final tkts 2... | \n", - "
3 | \n", - "U dun say so early hor... U c already then say... | \n", - "0 | \n", - "49 | \n", - "13 | \n", - "1 | \n", - "u dun say early hor u c already say | \n", - "
4 | \n", - "Nah I don't think he goes to usf, he lives aro... | \n", - "0 | \n", - "61 | \n", - "15 | \n", - "1 | \n", - "nah think go usf life around though | \n", - "
\n", + " | Text | \n", + "Label | \n", + "
---|---|---|
0 | \n", + "Go until jurong point, crazy.. Available only ... | \n", + "ham | \n", + "
1 | \n", + "Ok lar... Joking wif u oni... | \n", + "ham | \n", + "
2 | \n", + "Free entry in 2 a wkly comp to win FA Cup fina... | \n", + "spam | \n", + "
3 | \n", + "U dun say so early hor... U c already then say... | \n", + "ham | \n", + "
4 | \n", + "Nah I don't think he goes to usf, he lives aro... | \n", + "ham | \n", + "
\n", + " | 0 | \n", + "
---|---|
Text | \n", + "0 | \n", + "
Label | \n", + "0 | \n", + "
\n", + " | Text | \n", + "Label | \n", + "
---|---|---|
0 | \n", + "Go until jurong point, crazy.. Available only ... | \n", + "0 | \n", + "
1 | \n", + "Ok lar... Joking wif u oni... | \n", + "0 | \n", + "
2 | \n", + "Free entry in 2 a wkly comp to win FA Cup fina... | \n", + "1 | \n", + "
3 | \n", + "U dun say so early hor... U c already then say... | \n", + "0 | \n", + "
4 | \n", + "Nah I don't think he goes to usf, he lives aro... | \n", + "0 | \n", + "
\n", + " | Text | \n", + "Label | \n", + "num_chr | \n", + "num_words | \n", + "num_sent | \n", + "
---|---|---|---|---|---|
5557 | \n", + "Yeh. Indians was nice. Tho it did kane me off ... | \n", + "0 | \n", + "153 | \n", + "43 | \n", + "6 | \n", + "
2800 | \n", + "I've told him that i've returned it. That shou... | \n", + "0 | \n", + "63 | \n", + "17 | \n", + "2 | \n", + "
4223 | \n", + "Yo you around? A friend of mine's lookin to pi... | \n", + "0 | \n", + "65 | \n", + "15 | \n", + "2 | \n", + "
505 | \n", + "+123 Congratulations - in this week's competit... | \n", + "1 | \n", + "170 | \n", + "32 | \n", + "3 | \n", + "
2501 | \n", + "Remember to ask alex about his pizza | \n", + "0 | \n", + "36 | \n", + "7 | \n", + "1 | \n", + "
\n", + " | Label | \n", + "num_chr | \n", + "num_words | \n", + "num_sent | \n", + "
---|---|---|---|---|
count | \n", + "5171.000000 | \n", + "5171.000000 | \n", + "5171.000000 | \n", + "5171.000000 | \n", + "
mean | \n", + "0.126281 | \n", + "79.457552 | \n", + "18.590988 | \n", + "1.973893 | \n", + "
std | \n", + "0.332198 | \n", + "58.401504 | \n", + "13.383728 | \n", + "1.458880 | \n", + "
min | \n", + "0.000000 | \n", + "2.000000 | \n", + "1.000000 | \n", + "1.000000 | \n", + "
25% | \n", + "0.000000 | \n", + "36.000000 | \n", + "9.000000 | \n", + "1.000000 | \n", + "
50% | \n", + "0.000000 | \n", + "61.000000 | \n", + "15.000000 | \n", + "1.000000 | \n", + "
75% | \n", + "0.000000 | \n", + "119.000000 | \n", + "26.000000 | \n", + "2.000000 | \n", + "
max | \n", + "1.000000 | \n", + "910.000000 | \n", + "220.000000 | \n", + "38.000000 | \n", + "
\n", + " | num_chr | \n", + "num_words | \n", + "num_sent | \n", + "
---|---|---|---|
count | \n", + "5171.000000 | \n", + "5171.000000 | \n", + "5171.000000 | \n", + "
mean | \n", + "79.457552 | \n", + "18.590988 | \n", + "1.973893 | \n", + "
std | \n", + "58.401504 | \n", + "13.383728 | \n", + "1.458880 | \n", + "
min | \n", + "2.000000 | \n", + "1.000000 | \n", + "1.000000 | \n", + "
25% | \n", + "36.000000 | \n", + "9.000000 | \n", + "1.000000 | \n", + "
50% | \n", + "61.000000 | \n", + "15.000000 | \n", + "1.000000 | \n", + "
75% | \n", + "119.000000 | \n", + "26.000000 | \n", + "2.000000 | \n", + "
max | \n", + "910.000000 | \n", + "220.000000 | \n", + "38.000000 | \n", + "
\n", + " | num_chr | \n", + "num_words | \n", + "num_sent | \n", + "
---|---|---|---|
count | \n", + "4518.000000 | \n", + "4518.000000 | \n", + "4518.000000 | \n", + "
mean | \n", + "70.976538 | \n", + "17.265162 | \n", + "1.827579 | \n", + "
std | \n", + "56.610538 | \n", + "13.566409 | \n", + "1.394245 | \n", + "
min | \n", + "2.000000 | \n", + "1.000000 | \n", + "1.000000 | \n", + "
25% | \n", + "34.000000 | \n", + "8.000000 | \n", + "1.000000 | \n", + "
50% | \n", + "53.000000 | \n", + "13.000000 | \n", + "1.000000 | \n", + "
75% | \n", + "91.000000 | \n", + "22.000000 | \n", + "2.000000 | \n", + "
max | \n", + "910.000000 | \n", + "220.000000 | \n", + "38.000000 | \n", + "
\n", + " | num_chr | \n", + "num_words | \n", + "num_sent | \n", + "
---|---|---|---|
count | \n", + "653.000000 | \n", + "653.000000 | \n", + "653.000000 | \n", + "
mean | \n", + "138.136294 | \n", + "27.764165 | \n", + "2.986217 | \n", + "
std | \n", + "29.934972 | \n", + "6.988123 | \n", + "1.494815 | \n", + "
min | \n", + "13.000000 | \n", + "2.000000 | \n", + "1.000000 | \n", + "
25% | \n", + "132.000000 | \n", + "25.000000 | \n", + "2.000000 | \n", + "
50% | \n", + "149.000000 | \n", + "29.000000 | \n", + "3.000000 | \n", + "
75% | \n", + "157.000000 | \n", + "32.000000 | \n", + "4.000000 | \n", + "
max | \n", + "224.000000 | \n", + "46.000000 | \n", + "9.000000 | \n", + "
\n", + " | Text | \n", + "Label | \n", + "num_chr | \n", + "num_words | \n", + "num_sent | \n", + "Transformer_text | \n", + "
---|---|---|---|---|---|---|
0 | \n", + "Go until jurong point, crazy.. Available only ... | \n", + "0 | \n", + "111 | \n", + "24 | \n", + "2 | \n", + "go jurong point crazy available bugis n great ... | \n", + "
1 | \n", + "Ok lar... Joking wif u oni... | \n", + "0 | \n", + "29 | \n", + "8 | \n", + "2 | \n", + "ok lar joking wif u oni | \n", + "
2 | \n", + "Free entry in 2 a wkly comp to win FA Cup fina... | \n", + "1 | \n", + "155 | \n", + "37 | \n", + "2 | \n", + "free entry 2 wkly comp win fa cup final tkts 2... | \n", + "
3 | \n", + "U dun say so early hor... U c already then say... | \n", + "0 | \n", + "49 | \n", + "13 | \n", + "1 | \n", + "u dun say early hor u c already say | \n", + "
4 | \n", + "Nah I don't think he goes to usf, he lives aro... | \n", + "0 | \n", + "61 | \n", + "15 | \n", + "1 | \n", + "nah think go usf life around though | \n", + "
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", + " colsample_bylevel=None, colsample_bynode=None,\n", + " colsample_bytree=None, device=None, early_stopping_rounds=None,\n", + " enable_categorical=False, eval_metric='mlogloss',\n", + " feature_types=None, gamma=None, grow_policy=None,\n", + " importance_type=None, interaction_constraints=None,\n", + " learning_rate=0.24928047667141826, max_bin=None,\n", + " max_cat_threshold=None, max_cat_to_onehot=None,\n", + " max_delta_step=None, max_depth=5, max_leaves=None,\n", + " min_child_weight=None, missing=nan, monotone_constraints=None,\n", + " multi_strategy=None, n_estimators=142, n_jobs=None,\n", + " num_parallel_tree=None, random_state=None, ...)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
XGBClassifier(base_score=None, booster=None, callbacks=None,\n", + " colsample_bylevel=None, colsample_bynode=None,\n", + " colsample_bytree=None, device=None, early_stopping_rounds=None,\n", + " enable_categorical=False, eval_metric='mlogloss',\n", + " feature_types=None, gamma=None, grow_policy=None,\n", + " importance_type=None, interaction_constraints=None,\n", + " learning_rate=0.24928047667141826, max_bin=None,\n", + " max_cat_threshold=None, max_cat_to_onehot=None,\n", + " max_delta_step=None, max_depth=5, max_leaves=None,\n", + " min_child_weight=None, missing=nan, monotone_constraints=None,\n", + " multi_strategy=None, n_estimators=142, n_jobs=None,\n", + " num_parallel_tree=None, random_state=None, ...)