{ "cells": [ { "cell_type": "code", "execution_count": 4, "id": "68dfebbc", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "68dfebbc", "outputId": "80579e75-dfb3-46ea-dfe9-16713cbf0ab8" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " v1 v2 Unnamed: 2 \\\n", "0 ham Go until jurong point, crazy.. Available only ... NaN \n", "1 ham Ok lar... Joking wif u oni... NaN \n", "2 spam Free entry in 2 a wkly comp to win FA Cup fina... NaN \n", "3 ham U dun say so early hor... U c already then say... NaN \n", "4 ham Nah I don't think he goes to usf, he lives aro... NaN \n", "\n", " Unnamed: 3 Unnamed: 4 \n", "0 NaN NaN \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 NaN NaN " ], "text/html": [ "\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
v1v2Unnamed: 2Unnamed: 3Unnamed: 4
0hamGo until jurong point, crazy.. Available only ...NaNNaNNaN
1hamOk lar... Joking wif u oni...NaNNaNNaN
2spamFree entry in 2 a wkly comp to win FA Cup fina...NaNNaNNaN
3hamU dun say so early hor... U c already then say...NaNNaNNaN
4hamNah I don't think he goes to usf, he lives aro...NaNNaNNaN
\n", "
\n", "
\n", "\n", "
\n", " \n", "\n", " \n", "\n", " \n", "
\n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", " \n", "
\n", "\n", "
\n", "
\n" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "dataframe", "variable_name": "df", "summary": "{\n \"name\": \"df\",\n \"rows\": 5572,\n \"fields\": [\n {\n \"column\": \"v1\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"spam\",\n \"ham\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"v2\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5169,\n \"samples\": [\n \"Did u download the fring app?\",\n \"Pass dis to all ur contacts n see wat u get! Red;i'm in luv wid u. Blue;u put a smile on my face. Purple;u r realy hot. Pink;u r so swt. Orange;i thnk i lyk u. Green;i realy wana go out wid u. Yelow;i wnt u bck. Black;i'm jealous of u. Brown;i miss you Nw plz giv me one color\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Unnamed: 2\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 43,\n \"samples\": [\n \" GOD said\",\n \" SHE SHUDVETOLD U. DID URGRAN KNOW?NEWAY\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Unnamed: 3\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 10,\n \"samples\": [\n \" \\\\\\\"OH No! COMPETITION\\\\\\\". Who knew\",\n \" why to miss them\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Unnamed: 4\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"GNT:-)\\\"\",\n \" one day these two will become FREINDS FOREVER!\\\"\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" } }, "metadata": {}, "execution_count": 4 } ], "source": [ "import pandas as pd\n", "\n", "df = pd.read_csv('/content/drive/MyDrive/Colab Notebooks/DS25/spam.csv',encoding='latin1')\n", "\n", "df.head()" ] }, { "cell_type": "code", "source": [ "from google.colab import drive\n", "drive.mount('/content/drive')" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "XM9z3jeNj9tz", "outputId": "d13928c6-3292-481f-9567-d0b9da377d10" }, "id": "XM9z3jeNj9tz", "execution_count": 5, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n" ] } ] }, { "cell_type": "code", "execution_count": 6, "id": "a40ec53a", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "a40ec53a", "outputId": "f7f07c22-1764-43a4-9e5e-3a113ae64c08" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " v2 v1\n", "0 Go until jurong point, crazy.. Available only ... ham\n", "1 Ok lar... Joking wif u oni... ham\n", "2 Free entry in 2 a wkly comp to win FA Cup fina... spam\n", "3 U dun say so early hor... U c already then say... ham\n", "4 Nah I don't think he goes to usf, he lives aro... ham" ], "text/html": [ "\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
v2v1
0Go until jurong point, crazy.. Available only ...ham
1Ok lar... Joking wif u oni...ham
2Free entry in 2 a wkly comp to win FA Cup fina...spam
3U dun say so early hor... U c already then say...ham
4Nah I don't think he goes to usf, he lives aro...ham
\n", "
\n", "
\n", "\n", "
\n", " \n", "\n", " \n", "\n", " \n", "
\n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", " \n", "
\n", "\n", "
\n", "
\n" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "dataframe", "variable_name": "df", "summary": "{\n \"name\": \"df\",\n \"rows\": 5572,\n \"fields\": [\n {\n \"column\": \"v2\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5169,\n \"samples\": [\n \"Did u download the fring app?\",\n \"Pass dis to all ur contacts n see wat u get! Red;i'm in luv wid u. Blue;u put a smile on my face. Purple;u r realy hot. Pink;u r so swt. Orange;i thnk i lyk u. Green;i realy wana go out wid u. Yelow;i wnt u bck. Black;i'm jealous of u. Brown;i miss you Nw plz giv me one color\",\n \"Ok...\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"v1\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 2,\n \"samples\": [\n \"spam\",\n \"ham\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" } }, "metadata": {}, "execution_count": 6 } ], "source": [ "df = df[['v2','v1']]\n", "\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 7, "id": "12ef474a", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 147 }, "id": "12ef474a", "outputId": "d9b84ab1-f142-4d31-d334-0a20677f4c72" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "v2 0\n", "v1 0\n", "dtype: int64" ], "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
0
v20
v10
\n", "

" ] }, "metadata": {}, "execution_count": 7 } ], "source": [ "df.isnull().sum()" ] }, { "cell_type": "code", "execution_count": 8, "id": "776032f0", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 206 }, "id": "776032f0", "outputId": "ba137f5e-66e2-4d11-9888-5fe20073492b" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " v2 v1\n", "0 Go until jurong point, crazy.. Available only ... 0\n", "1 Ok lar... Joking wif u oni... 0\n", "2 Free entry in 2 a wkly comp to win FA Cup fina... 1\n", "3 U dun say so early hor... U c already then say... 0\n", "4 Nah I don't think he goes to usf, he lives aro... 0" ], "text/html": [ "\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
v2v1
0Go until jurong point, crazy.. Available only ...0
1Ok lar... Joking wif u oni...0
2Free entry in 2 a wkly comp to win FA Cup fina...1
3U dun say so early hor... U c already then say...0
4Nah I don't think he goes to usf, he lives aro...0
\n", "
\n", "
\n", "\n", "
\n", " \n", "\n", " \n", "\n", " \n", "
\n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", " \n", "
\n", "\n", "
\n", "
\n" ], "application/vnd.google.colaboratory.intrinsic+json": { "type": "dataframe", "variable_name": "df", "summary": "{\n \"name\": \"df\",\n \"rows\": 5572,\n \"fields\": [\n {\n \"column\": \"v2\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5169,\n \"samples\": [\n \"Did u download the fring app?\",\n \"Pass dis to all ur contacts n see wat u get! Red;i'm in luv wid u. Blue;u put a smile on my face. Purple;u r realy hot. Pink;u r so swt. Orange;i thnk i lyk u. Green;i realy wana go out wid u. Yelow;i wnt u bck. Black;i'm jealous of u. Brown;i miss you Nw plz giv me one color\",\n \"Ok...\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"v1\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 1,\n 0\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}" } }, "metadata": {}, "execution_count": 8 } ], "source": [ "df['v1'] = df['v1'].map({'ham':0,'spam':1})\n", "\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 9, "id": "44c5083f", "metadata": { "id": "44c5083f" }, "outputs": [], "source": [ "x = df['v2']\n", "\n", "y = df['v1']" ] }, { "cell_type": "code", "execution_count": 10, "id": "f9654d1f", "metadata": { "id": "f9654d1f" }, "outputs": [], "source": [ "from sklearn.model_selection import train_test_split" ] }, { "cell_type": "code", "execution_count": 11, "id": "1e230240", "metadata": { "id": "1e230240" }, "outputs": [], "source": [ "x_train,x_test,y_train,y_test = train_test_split(x,y,test_size=0.2,random_state=42)" ] }, { "cell_type": "code", "execution_count": 12, "id": "b3f2dc41", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "b3f2dc41", "outputId": "772e0aac-39b2-4d68-ae17-ad6f5e0f650e" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "4457" ] }, "metadata": {}, "execution_count": 12 } ], "source": [ "len(x_train)" ] }, { "cell_type": "code", "execution_count": 13, "id": "21888d5b", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "21888d5b", "outputId": "43be9fb4-d76d-4484-b2c7-e29193d1dd33" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "1115" ] }, "metadata": {}, "execution_count": 13 } ], "source": [ "len(x_test)" ] }, { "cell_type": "markdown", "id": "4e30ca04", "metadata": { "id": "4e30ca04" }, "source": [ " let's preprocess text column now" ] }, { "cell_type": "code", "execution_count": 14, "id": "384b9817", "metadata": { "id": "384b9817" }, "outputs": [], "source": [ "from sklearn.feature_extraction.text import TfidfVectorizer" ] }, { "cell_type": "code", "execution_count": 15, "id": "90f45ff7", "metadata": { "id": "90f45ff7" }, "outputs": [], "source": [ "tfd = TfidfVectorizer(stop_words='english')\n", "\n", "\n", "x_train_final = tfd.fit_transform(x_train)\n", "\n", "x_test_final = tfd.transform(x_test)" ] }, { "cell_type": "markdown", "id": "473b0720", "metadata": { "id": "473b0720" }, "source": [ "## model training" ] }, { "cell_type": "code", "execution_count": 16, "id": "94f28d1b", "metadata": { "id": "94f28d1b" }, "outputs": [], "source": [ "from sklearn.naive_bayes import MultinomialNB" ] }, { "cell_type": "code", "execution_count": 17, "id": "d406c405", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 80 }, "id": "d406c405", "outputId": "d7e0082d-9c38-42ff-9e60-9c446d509c45" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "MultinomialNB()" ], "text/html": [ "
MultinomialNB()
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
" ] }, "metadata": {}, "execution_count": 17 } ], "source": [ "model = MultinomialNB()\n", "\n", "model.fit(x_train_final,y_train)" ] }, { "cell_type": "markdown", "id": "91fe1bf2", "metadata": { "id": "91fe1bf2" }, "source": [ "## model testing" ] }, { "cell_type": "code", "execution_count": 18, "id": "7c44540b", "metadata": { "id": "7c44540b" }, "outputs": [], "source": [ "from sklearn.metrics import classification_report" ] }, { "cell_type": "code", "execution_count": 19, "id": "ec824818", "metadata": { "id": "ec824818" }, "outputs": [], "source": [ "y_pred = model.predict(x_test_final)" ] }, { "cell_type": "code", "execution_count": 20, "id": "0f103e37", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "0f103e37", "outputId": "24ad9f3b-7276-4f99-eeda-ff5a33e8e64b" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ " precision recall f1-score support\n", "\n", " 0 0.96 1.00 0.98 965\n", " 1 1.00 0.75 0.86 150\n", "\n", " accuracy 0.97 1115\n", " macro avg 0.98 0.88 0.92 1115\n", "weighted avg 0.97 0.97 0.96 1115\n", "\n" ] } ], "source": [ "cr = classification_report(y_test,y_pred)\n", "\n", "print(cr)" ] }, { "cell_type": "markdown", "id": "c1da6516", "metadata": { "id": "c1da6516" }, "source": [ "**Check individual email**" ] }, { "cell_type": "code", "execution_count": 21, "id": "45d1e3c1", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "45d1e3c1", "outputId": "8e846bfc-0c28-4ee9-94fa-62af679f2a34" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "array([1])" ] }, "metadata": {}, "execution_count": 21 } ], "source": [ "inp = ['''Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&C's apply 08452810075over18's\n", "''']\n", "\n", "\n", "inp_final = tfd.transform(inp)\n", "\n", "model.predict(inp_final)" ] }, { "cell_type": "markdown", "id": "45a632b0", "metadata": { "id": "45a632b0" }, "source": [ "**Practice**" ] }, { "cell_type": "code", "execution_count": 22, "id": "9eacaf9e", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 356 }, "id": "9eacaf9e", "outputId": "6697ee8d-9787-4d53-94b5-93ba310e9c52" }, "outputs": [ { "output_type": "error", "ename": "KeyboardInterrupt", "evalue": "Interrupted by user", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "\u001b[0;32m/tmp/ipython-input-273501035.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0memail\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Please provide the email:\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0memail\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtfd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtransform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0memail\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0memail\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 1175\u001b[0m \u001b[0;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1176\u001b[0m )\n\u001b[0;32m-> 1177\u001b[0;31m return self._input_request(\n\u001b[0m\u001b[1;32m 1178\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprompt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1179\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"shell\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 1217\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1218\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1219\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Interrupted by user\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1220\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1221\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Invalid Message:\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mKeyboardInterrupt\u001b[0m: Interrupted by user" ] } ], "source": [ "email = input(\"Please provide the email:\")\n", "\n", "email = tfd.transform([email])\n", "\n", "out = model.predict(email)[0]\n", "\n", "if out==0:\n", "\n", " print(\"\\nThe entered email is not a spam\")\n", "\n", "else:\n", "\n", " print(\"\\nThe entered email is a Spam\")" ] }, { "cell_type": "code", "execution_count": 23, "id": "40065daf", "metadata": { "id": "40065daf" }, "outputs": [], "source": [ "from joblib import dump" ] }, { "cell_type": "code", "execution_count": 24, "id": "64908369", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "64908369", "outputId": "e84fac0a-df4f-4375-c611-ec8451926a49" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "['model.joblib']" ] }, "metadata": {}, "execution_count": 24 } ], "source": [ "dump(model,\"model.joblib\")" ] }, { "cell_type": "code", "execution_count": 25, "id": "d7d47cf2", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "d7d47cf2", "outputId": "00dfb556-c1c3-427f-9f35-e630afdd0c47" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "['tfd.joblib']" ] }, "metadata": {}, "execution_count": 25 } ], "source": [ "dump(tfd,\"tfd.joblib\")" ] }, { "cell_type": "code", "source": [], "metadata": { "id": "bsjaW-Rjkj_R" }, "id": "bsjaW-Rjkj_R", "execution_count": null, "outputs": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" }, "colab": { "provenance": [] } }, "nbformat": 4, "nbformat_minor": 5 }