.. _Doc_BoxAlgorithm_ClassifierProcessor: Classifier processor ==================== .. container:: attribution :Author: Yann Renard, Guillaume Serriere :Company: INRIA/IRISA .. image:: images/Doc_BoxAlgorithm_ClassifierProcessor.png Classifies incoming feature vectors using a previously learned classifier. The *Classifier Processor* box is a generic box for classifying data (feature vectors). It works in conjunction with the :ref:`Doc_BoxAlgorithm_ClassifierTrainer` box. This box' role is to expose a generic interface to the rest of the BCI pipeline. The vectors to classify are forwarded to an algorithm or a structure of algorithms depending on what is described in the loaded configuration file. The behavior is simple: at initialization phase, the classification structure is initialized and its configuration is loaded from the configuration file. Then each time this box receives a new feature vector, it is forwarded to the classification algorithm that classifies it. The box gets the algorithm status and the actual class value and translates this information to its output. The predicted class is sent out in the form of a stimulation and the algorithm status is sent in the form a streamed matrix. The stimulation can be generically interpreted by the rest of the pipeline but it is important to understand that each classification algorithm is free to report whatever it wants in its "status matrix". Consequently, the use of this output stream will be dependent on the chosen classification algorithm. For example, the LDA classifier sends the hyperplane distance value as its status. Inputs ------ .. csv-table:: :header: "Input Name", "Stream Type" "Features", "Feature vector" "Commands", "Stimulations" Features ~~~~~~~~ This input should be connected to the feature vector stream to classify. Each time a new feature vector arrives, a classification process will be triggered. Consequently, a classification stimulation will be sent on the first output of this box. Outputs ------- .. csv-table:: :header: "Output Name", "Stream Type" "Labels", "Stimulations" "Hyperplane distance", "Streamed matrix" "Probability values", "Streamed matrix" Labels ~~~~~~ This output will contain the classification stimulations. Each time a new feature vector arrives to this box, a new classification process is triggered, resulting in the generation of the corresponding class stimulation. Hyperplane distance ~~~~~~~~~~~~~~~~~~~ This output reflects the classification algorithm status in the form of a matrix of value. This output will contain one or several distances to an hyperplane if the classifier provide it. If not, the matrix will have 0 dimension. The format of this output directly depend on the classification algorithm and of the strategy used by the processor box. Probability values ~~~~~~~~~~~~~~~~~~ This output reflects the classification algorithm status in the form of a matrix of value. This output will contains one or several probabilities for a data to be on a class if the classifier provide it. If not, the matrix will have 0 dimension. The format of this output directly depend on the classification algorithm and of the strategy used by the processor box. .. _Doc_BoxAlgorithm_ClassifierProcessor_Settings: Settings -------- .. csv-table:: :header: "Setting Name", "Type", "Default Value" "Filename to load configuration from", "Filename", "" Filename to load configuration from ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This setting points to the configuration file of the box generated by the :ref:`Doc_BoxAlgorithm_ClassifierTrainer` box. Its syntax depends on the selected algorithm. .. _Doc_BoxAlgorithm_ClassifierProcessor_Examples: Examples -------- This box is used in BCI pipelines in order to classify cerebral activity states. For a detailed scenario using this box and its associated :ref:`Doc_BoxAlgorithm_ClassifierTrainer`, please see the **motor imagary** BCI scenario in the sample scenarios.