I am trying to build a model that predicts if an email is spam/not-spam. After building a logistic regression model, I have got the following results:
precision recall f1-score support
0.0 0.92 0.99 0.95 585
1.0 0.76 0.35 0.48 74
accuracy 0.92 659
macro avg 0.84 0.67 0.72 659
weighted avg 0.91 0.92 0.90 659
Confusion Matrix:
[[577 8]
[ 48 26]]
Accuracy: 0.9150227617602428
The F1-score is the metric I am looking at. I am having difficulties in explaining the results: I think are very bad results! May I ask you how I could improve it? I am currently considering a model that looks at corpus of the emails (subject + corpus).
After Erwan's answer:
I oversampled the dataset and these are my results:
Logistic regression
precision recall f1-score support
0.0 0.94 0.77 0.85 573
1.0 0.81 0.96 0.88 598
accuracy 0.86 1171
macro avg 0.88 0.86 0.86 1171
weighted avg 0.88 0.86 0.86 1171
Random Forest
precision recall f1-score support
0.0 0.97 0.54 0.69 573
1.0 0.69 0.98 0.81 598
accuracy 0.77 1171
macro avg 0.83 0.76 0.75 1171
weighted avg 0.83 0.77 0.75 1171