python-crfsuite icon indicating copy to clipboard operation
python-crfsuite copied to clipboard

Are there any plans to expose cross validation and other training performance outside of stdout?

Open samgalen opened this issue 9 years ago • 3 comments

As far as I can tell, right now, when someone uses the holdout feature on a Trainer object (when verbose is set to True), you get a printout of information at each step about how the trainer is training and how it's performing on the holdout group. Aside from creating a tagger object and essentially repeating the validation that's already happened, the printout appears to be the only way that information is exposed.

It would be really handy to be able to access training information in a less clunky way! Unless, of course, there's some other way, that I haven't seen yet.

samgalen avatar Jun 22 '16 15:06 samgalen

Hey @samgalen,

It is not documented, but there is a way to access this training log: it is parsed by https://github.com/tpeng/python-crfsuite/blob/master/pycrfsuite/_logparser.py, and the logparser object is available as trainer.logparser. You may find trainer.logparser.iterations or trainer.logparser.last_iteration attributes useful.

kmike avatar Jun 22 '16 16:06 kmike

Oh that's exactly what I was looking for!

Would you be averse to a pull request to add these features to the example notebook?

samgalen avatar Jun 22 '16 18:06 samgalen

Yeah, that'd be nice!

kmike avatar Jun 22 '16 18:06 kmike