Spam Classifier¶
¶
classify_email(email)
¶
Classify spam possibility of given email.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
email |
str |
Raw e-mail. |
required |
Returns:
Type | Description |
---|---|
int |
Spam or not. |
Source code in spampy/spam_classifier.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
classify_email_with_enron(email)
¶
Classify spam possibility of given email with enron dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
email |
str |
Raw e-mail. |
required |
Returns:
Type | Description |
---|---|
int |
Spam or not. |
Source code in spampy/spam_classifier.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
load_test_set()
¶
Load test set and return features and labels.
Returns:
Type | Description |
---|---|
Tuple[List, List] |
Test features and labels. |
Source code in spampy/spam_classifier.py
37 38 39 40 41 42 43 44 45 46 47 |
|
load_training_set()
¶
Load training set and return features and labels.
Returns:
Type | Description |
---|---|
Tuple[List, List] |
Training features and labels. |
Source code in spampy/spam_classifier.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
train_svm()
¶
Fit SVM with features and labels.
Source code in spampy/spam_classifier.py
50 51 52 53 54 55 56 |
|