Re: A spambayes-esque approach for 4 email categories

Tim Peters <[email protected]> Wed, 24 Apr 2024 23:59:08 -0500
Newsgroups gmane.mail.spam.spambayes.devel
Message-ID <CAExdVNmn5oBS0r4YwQmezj3JM3GT_Osn_YSamF2Fv8ZLxWrejg@mail.gmail.com>
--===============5951646723784960897==
Content-Type: multipart/alternative; boundary="00000000000059cb570616e4a6a6"

--00000000000059cb570616e4a6a6
Content-Type: text/plain; charset="UTF-8"

[Amedee Van Gasse <[email protected]>]

> ...
>

> The emails are labelled thus:
> * Phishing (3k) -> these are emails with a direct security threat, like
> password stealing
> * Spam (2k) --> typical junk mail that is not a direct security threat
> * Graymail (3k) --> newsletters, mails from sales people, invitations for
> conferences... all somewhat relevant for our industry, but recipients just
> aren't interested. This is "it's not actually spam because I subscribed a
> long time ago and now I am too lazy to unsubscribe"
> * False positive (0.5k) --> emails that were mistakenly reported as spam
> * Uncategorized (1.5k) --> these emails have not yet been manually reviewed
>
> I know that Spambayes works with just two buckets: spam and not-spam.
> Given the number of manually categorized emails I already have, how
> feasible would it be to write something similar but with 4 buckets, and to
> have the emails as training data? I am not concerned with 100% accuracy,
> even 80% is good enough.
> Maybe I could use 4 separate databases instead of just one?
>

I haven't done any work in this field for over a decade either, alas. Way
back when, I tried adopting the approach to a multi-category system, but
with scant success. But I didn't have much time to give to it either.

Wikipedia has a good overview of strategies of ways to _try_ tu use a
2-category system to do N-way classification:

https://en.wikipedia.org/wiki/Multiclass_classification

While it says "naive Bayes" "is naturally extensible to the case of having
more than two classes", the math behind Spambayes is more advanced than in
"naive Bayes", and deeply believes it's a 2-category world.

But the best way to find out about anything is to try it :-) Good luck!

--00000000000059cb570616e4a6a6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">[Amedee Van Gasse &lt;<a href=3D"mailto:a=
[email protected]">[email protected]</a>&gt;]<br></div><div =
class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"ltr">...</div></blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div><br></div><div>The emails are labelled thu=
s:</div><div>* Phishing (3k) -&gt; these are emails with a direct security =
threat, like password stealing</div><div>* Spam (2k) --&gt; typical junk ma=
il that is not a direct security threat</div><div>* Graymail (3k) --&gt; ne=
wsletters, mails from sales people, invitations for conferences... all some=
what relevant for our industry, but recipients=C2=A0just aren&#39;t interes=
ted. This is &quot;it&#39;s not actually spam because I subscribed a long t=
ime ago and now I am too lazy to unsubscribe&quot;</div><div>* False positi=
ve (0.5k) --&gt; emails that were mistakenly reported as spam</div><div>* U=
ncategorized (1.5k) --&gt; these emails have not yet been manually reviewed=
</div><div><br></div><div>I know that Spambayes works with just two buckets=
: spam and not-spam.</div><div>Given the number of manually categorized ema=
ils I already have, how feasible would it be to write something similar but=
 with 4 buckets, and to have the emails as training data? I am not concerne=
d with 100% accuracy, even 80% is good enough.</div><div>Maybe I could use =
4 separate databases instead of just one?</div></div></blockquote><div><br>=
</div><div>I haven&#39;t done any work in this field for over a decade eith=
er, alas. Way back when, I tried adopting the approach=C2=A0to a multi-cate=
gory=C2=A0system, but with scant success. But I didn&#39;t have much time t=
o give to it either.<br><br>Wikipedia has a good overview of strategies of =
ways to _try_ tu use a 2-category system to do N-way classification:<br><br=
><a href=3D"https://en.wikipedia.org/wiki/Multiclass_classification">https:=
//en.wikipedia.org/wiki/Multiclass_classification</a><br><br>While it says =
&quot;naive Bayes&quot; &quot;<span style=3D"color:rgb(32,33,34);font-famil=
y:sans-serif;font-size:14px">is naturally extensible to the case of having =
more than two classes&quot;, the math behind Spambayes is more advanced tha=
n in &quot;naive Bayes&quot;, and deeply believes it&#39;s a 2-category wor=
ld.<br><br>But the best way to find out about anything is to try it :-) Goo=
d luck!<br><br></span></div></div></div>

--00000000000059cb570616e4a6a6--

--===============5951646723784960897==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
spambayes-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/spambayes-dev

--===============5951646723784960897==--