🛠 Mini Project: Spam Classifier with Machine Learning

🛠 Mini Project: Spam Classifier with Machine Learning

In this mini project, we'll build a simple Spam Classifier using Machine Learning techniques. We’ll use TF-IDF Vectorization for feature extraction and a Naive Bayes Classifier for classification.

🔹 Step 1: Import Required Libraries

We'll need scikit-learn library, which provides all the tools we need.

🔹 Step 2: Prepare the Data

We create a small dataset with labels "spam" and "ham" (not spam).

🔹 Step 3: Build and Train the Model

We will transform the text messages into numerical vectors using TF-IDF and train a Naive Bayes classifier.

🔹 Sample Output:

Accuracy: 1.0
Prediction: spam

Comments