Re: dstttr
Ger Hobbelt <[email protected]>
| Newsgroups | gmane.mail.spam.crm114 |
|---|---|
| Message-ID | <[email protected]> |
Sorry, no.
What you appear to be doing there is something akin to SSTTT (Single
Sided Thick Threshold Training), so no DS (Double Sided) nor the R
(for Reinforcement).
The R is not there as the training is not repeated (I didn't see the
'liaf' loop statement in there ;-) ) to continue the training until
the threshold is passed (or there's no more improvement to be had --
mailtrainer checks against the threshold; you check against the
latter, or so it looks (the 3.0 pR improvement after a training).
Personally I'd go with the threshold check as the stop criterium for
such a training loop, but I can't find a sufficiently detailed
description for DSTTTR in the papers I have around here, so quiting
the training loop on a sufficient improvement is okay too -- until the
experts chime in. ;-)
The DS means you learn in class C *plus* you learn <refute> the same
message in _all_ _the_ _other_ _classes_.
There's the subtle detail regarding 'double sided', and that's the
question whether it's those two trainings done:
1) simultaneously: (learn (C) + learn <refute> (each-in-set-minus-C))
[which is only a good thing when you use winnow], or:
2) consecutively: (learn (C), if reclassify still below threshold,
learn <refute> (each-in-set-minus-C)) [which /might/ be useful for any
of the other classifiers]
and then, would we call #2 'R'einforcement?
>From my POV, double sided is only good for Winnow, but you'll have to
test whether it actually improves results over SSTTT[R] for any of the
other classifiers.
If I take mailtrainer as a 'reference' for all this, DSTTTR is done as
a train + reclassify loop, where the stop criterium is compound:
- either the threshold is passed on the last reclassfication
('classify' test), or
- a preset upper bound for the number of iterations is reached.
where each round is the sequence:
- learn (class)
- [re]classify
- when new pR/class result is still wrong/below threshold,
and 'double sided' (refute_training is mailtrainer parlance) is selected:
- - learn <refute> (the other classes]
- - [re]classify
- increment iteration count
But... there's two other things that pop out in your script:
a) the code looks like it assumes each classification will at least
succeed in so far as that the 'right class' will be picked. Why do I
say this? Because this code (edited):
classify <osbf microgroom> [:article:] \
(bus.cfc cli.cfc con.cfc cul.cfc dep.cfc \
dis.cfc dom.cfc eco.cfc edu.cfc ene.cfc \
ent.cfc env.cfc fac.cfc fam.cfc for.cfc \
hea.cfc int.cfc lei.cfc loc.cfc nat.cfc \
pol.cfc sci.cfc spo.cfc tec.cfc tra.cfc \
wor.cfc you.cfc | unc.cfc out.cfc) (:stats:)
match (:: :class-conc:) [:stats:] /(...)\.cfc/
{
match (:: :pR:) [:stats:] /Best match.*: (.*) \nTotal/
eval /:@::*:pR: > 10:/
output /Classification succeeded as ':*:class-conc:'\n/
return
}
isolate (:conc-file:) /:*:class-conc:.cfc/
learn <osbf microgroom> (:*:conc-file:) [:article:]
extracts the name of the class to train into from the classify output.
Are you _really_ sure you want that? Because now false classifications
will be trained when their pR is below 10 (and for the wrong class).
b) there's an interesting comment in that piece of code as well (unedited):
{
match (:: :pR:) [:stats:] /Best match.*: (.*) \nTotal/
isolate (:bool:)
eval (:bool:) /:@:(:*:pR: > 10) + (2 > 1):/ #i get errors
when the bool = 0, so i rig it to be 1 or 2.
match [:bool:] /2/
output /Classification succeeded as ':*:class-conc:'\n/
return
}
what errors did you get? (You're wicked, you know that? Adding a
second conditional in there like that, which will be evaluated after
the first and always flag 'true' so eval will not 'fail' to the outer
{} scope. Hadn't thought of that one before.)
And didn't this code (which should be equivalent to yours, flow-wise,
and minus the :bool:) work for you:
{
match (:: :pR:) [:stats:] /Best match.*: (.*) \nTotal/
eval /:@::*:pR: > 10:/
output /Classification succeeded as ':*:class-conc:'\n/
return
}
# we land here when the eval check fails... (or when the
match doesn't hit pay dirt)
--
Met vriendelijke groeten / Best regards,
Ger Hobbelt
--------------------------------------------------
web: http://www.hobbelt.com/
http://www.hebbut.net/
mail: [email protected]
mobile: +31-6-11 120 978
--------------------------------------------------
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H