{ "cells": [ { "cell_type": "markdown", "id": "7c067bf9", "metadata": {}, "source": [ "# Naive Bayes" ] }, { "cell_type": "markdown", "id": "da2a88bd", "metadata": {}, "source": [ "[Tutorial - How to build a Spam Classifier in python and sklearn - milindsoorya.site](https://milindsoorya.site/blog/build-a-spam-classifier-in-python)" ] }, { "cell_type": "code", "execution_count": 1, "id": "d5deff12", "metadata": {}, "outputs": [], "source": [ "train_spam = ['send us your password', 'review our website', 'send your password', 'send us your account']\n", "train_ham = ['Your activity report','benefits physical activity', 'the importance vows']\n", "test_spam = ['renew your password', 'renew your vows']\n", "test_ham = ['benefits of our account', 'the importance of physical activity']" ] }, { "cell_type": "code", "execution_count": 5, "id": "30220879", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 101, "id": "a7b271ba", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | text | \n", "label | \n", "
---|---|---|
0 | \n", "send us your password | \n", "1 | \n", "
1 | \n", "review our website | \n", "1 | \n", "
2 | \n", "send your password | \n", "1 | \n", "
3 | \n", "send us your account | \n", "1 | \n", "
4 | \n", "renew your password | \n", "1 | \n", "
5 | \n", "renew your vows | \n", "1 | \n", "
6 | \n", "Your activity report | \n", "0 | \n", "
7 | \n", "benefits physical activity | \n", "0 | \n", "
8 | \n", "the importance vows | \n", "0 | \n", "
9 | \n", "benefits of our account | \n", "0 | \n", "
10 | \n", "the importance of physical activity | \n", "0 | \n", "