Bases: onyx.dataflow.streamprocess.ProcessorBase
A processor to track and print classification accuracy
Incoming events should be in the form output by classifying processors, see AdaptingClassProcessor. Events are sent through without modification. The debug flag ‘acc_track’ can be turned on to cause interesting information to be output in chartable form.
>>> at = AccTracker(sending=False)
>>> right = ('A', ((1, 'A'), (0, 'B')))
>>> wrong = ('B', ((1, 'A'), (0, 'B')))
>>> input = tuple(([right]* 25 + [wrong] * 10) * 40)
>>> len(input)
1400
>>> with DebugPrint('acc_track'):
... for item in input:
... at.process(item)
| | | | * | |
| | | | * | |
| | | | x + | |
| | | | x + | |
| | | | x + | |
| | | | x+ | |
| | | | x+ | |
| | | | +x | |
| | | | + x | |
| | | | * | |
| | | | x+ | |
| | | | x+ | |
| | | | x+ | |
| | | | x+ | |
A debug context for this processor. This attribute is an object returned by dcheck() in the onyx.util.debugprint module, and may be used for debug output. The tag for turning on such output is available as debug_tag
Activate this tag to get debugging information, see onyx.util.debugprint.DebugPrint
Return a graph for this processor. By default this is just a single node whose label is the label of processor; derived classes may wish to override this property.
Return a label for this processor. By default this is just the name of the class; derived classes may wish to override this property by providing a different label to __init__().
Internal function that pushes result into the sendee. Implementations of process() must call this to push results. To set up the sendee, (the target of the push), clients of the processor must either initialize the object with a sendee, or call set_sendee(). Processors created with a sendee of False will never send, but will not error if send is called.
The callable this processor will use to send events; see set_sendee()
Whether this processor will currently send events at all; see set_sending()
Clients call this to set up the callable where the processor will send its results.
Clients call this to turn sending from a processor on or off.