prediction¶
Module: environments.live.prediction
¶
Script to run the actual online classification of data
Inheritance diagram for pySPACE.environments.live.prediction
:
Class Summary¶
SimpleResultCollection (name, params[, store]) |
Base Class for Result collection. |
ConfusionMatrix (name, params) |
A confusion matrix. |
Predictor ([live_processing]) |
Class that is responsible to perform the actual predictions. |
Classes¶
SimpleResultCollection
¶
-
class
pySPACE.environments.live.prediction.
SimpleResultCollection
(name, params, store=True)[source]¶ Bases:
object
Base Class for Result collection.
Default behaviour is counting occurring events in a dictionary.
Parameters
name: potential-name (e.g. LRP) params: parameter/meta-data of the potential store: write result to a pickle file Class Components Summary
__repr__
()dump
()simple print function event_notification
(event_str)simple event counting -
__weakref__
¶ list of weak references to the object (if defined)
-
ConfusionMatrix
¶
-
class
pySPACE.environments.live.prediction.
ConfusionMatrix
(name, params)[source]¶ Bases:
pySPACE.environments.live.prediction.SimpleResultCollection
A confusion matrix.
Stores and handles a confusion matrix. The confusion matrix is assumed to have the following form:
prediction P N actual P TP FN N FP TN Parameters
name: potential-name (e.g. LRP) params: parameter/meta-data of the potential Class Components Summary
__repr__
()dump
()prints the collected result of the confusion matrix event_notification
(event_str)Update the confusion matrix -
event_notification
(event_str)[source]¶ Update the confusion matrix
It is assumed that we receive a trigger event after the classification result (either pos. or neg.-event). If the trigger_event occurrs it is a validation for a positive prediction. If no trigger_event but instead another classification result comes in it is assumed that no reaction on the previously presented target appeared.
-
Predictor
¶
-
class
pySPACE.environments.live.prediction.
Predictor
(live_processing=None)[source]¶ Bases:
object
Class that is responsible to perform the actual predictions.
Class Components Summary
__del__
()create_processor_logger
()Create specific logger for the prediction initialize_xmlrpc
(controller_host, ...[, ...])Setup communication to remote listeners is_predicting_active
()Returns whether prediction phase is finished or still running load_model
(directory, datasets)Store the learned models pause_prediction
()prepare_predicting
(datasets[, testing_data, ...])Prepares the trained aBRI-DP flows to classify new instances. process_external_command
(command)set_controller
(controller)Set reference to the controller set_eeg_stream_manager
(stream_manager)Set manager class that provides the actual data for the prediction start_predicting
([trace])Classify new instances based on the learned aBRI-DP flows. stop_predicting
()Force the end of the predicting -
initialize_xmlrpc
(controller_host, controller_port, mars_host='127.0.0.1', mars_port=8080)[source]¶ Setup communication to remote listeners
This method tells ABRIProcessing which remote processes are interested in being informed about its classification results.
-
set_eeg_stream_manager
(stream_manager)[source]¶ Set manager class that provides the actual data for the prediction
-
prepare_predicting
(datasets, testing_data=None, nullmarker_stride_ms=None)[source]¶ Prepares the trained aBRI-DP flows to classify new instances.
-
__weakref__
¶ list of weak references to the object (if defined)
-