Spam Doggy
Spam Doggy is a spam classifier that uses a Naive Bayes classifier to classify emails as spam or not spam. It is designed to be easy to use and efficient, leveraging the power of machine learning to accurately identify unwanted emails.
Features
- Utilizes a Naive Bayes classifier for efficient spam detection.
- Easy to train with custom datasets.
- Supports saving and loading models for quick predictions without retraining.
Installation
To use Spam Doggy, you need to have Python installed along with some additional dependencies. You can install the necessary packages using:
pip install -r requirements.txt
Usage
train model
from spam_doggy import SpamDoggy
# Load default training data
spam_doggy = SpamDoggy()
spam_doggy.set_default_training_data()
# Train the model
spam_doggy.train(print_report=True)
# Save the trained model and vectorizer
spam_doggy.save_model('vectorizer.joblib', 'classifier.joblib')
load model
# Create a new instance of SpamDoggy
spam_doggy = SpamDoggy()
# Load the pre-trained model and vectorizer
spam_doggy.load_model('vectorizer.joblib', 'classifier.joblib')
# Predict the class of a new email
email_text = "Congratulations! You've won a free cruise. Call now to claim your prize."
prediction = spam_doggy.predict(email_text)
print(f"The email is classified as: {prediction}")
custom dataset
If you want to train the model with your own dataset, ensure your data is in a pandas.DataFrame with two columns: Message (the email text) and Category (the label: "spam" or "not spam").
import pandas as pd
# Example custom data
data = {'Message': ["Free money", "Hi there, how are you?", "Limited time offer!"],
'Category': ["spam", "not spam", "spam"]}
custom_df = pd.DataFrame(data)
# Train with custom data
spam_doggy = SpamDoggy()
spam_doggy.set_train_data(custom_df)
spam_doggy.train(print_report=True)
Metadata
Release files for spam-doggy 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spam_doggy-1.0.1.tar.gz | 4.6 kB | Without provenance | Details for spam_doggy-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spam_doggy-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for spam_doggy-1.0.1-py3-none-any.whl |
Total release size: 9.8 kB
Release files / spam_doggy-1.0.1.tar.gz
| Download URL | spam_doggy-1.0.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d401d64ef28bdbf77ccdb44003999c523ba869d662e445d3547f6fd3d598284
|
|
BLAKE2b-256 checksum How to use checksums |
25ee44b381f06a2db168c3c7824b7a157d2a659f219ff94c02971e1e98a3693b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / spam_doggy-1.0.1-py3-none-any.whl
| Download URL | spam_doggy-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88439c923760e7af25269d14e08ff3da33754e147c0fe70ab4d65f79069fc735
|
|
BLAKE2b-256 checksum How to use checksums |
3a7d5464d5ae6889f44f2f994be48f02e960b5b68b31578c7590d35e6740b4f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Security for spam-doggy 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.