Commit 7f6a1336 authored by Jussi Lindgren's avatar Jussi Lindgren
Browse files

plugins/boxes:

 + Added 'classification'


git-svn-id: svn://scm.gforge.inria.fr/svn/openvibe@3624 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f
parent 84ebb2e5
PROJECT(openvibe-plugins-classification)
SET(PROJECT_VERSION_MAJOR ${OV_GLOBAL_VERSION_MAJOR})
SET(PROJECT_VERSION_MINOR ${OV_GLOBAL_VERSION_MINOR})
SET(PROJECT_VERSION_PATCH ${OV_GLOBAL_VERSION_PATCH})
SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
FILE(GLOB_RECURSE source_files src/*.cpp src/*.h src/*.inl)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${source_files})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
COMPILE_FLAGS "-DOV_Exports -DOV_Shared")
INCLUDE("FindOpenViBE")
INCLUDE("FindOpenViBECommon")
INCLUDE("FindOpenViBEToolkit")
INCLUDE("FindOpenViBEModuleEBML")
INCLUDE("FindOpenViBEModuleSystem")
INCLUDE("FindOpenViBEModuleXML")
# ---------------------------------
# Target macros
# Defines target operating system
# Defines target architecture
# Defines target compiler
# ---------------------------------
IF(WIN32)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-DTARGET_OS_Windows)
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_i386)
ADD_DEFINITIONS(-DTARGET_COMPILER_VisualStudio)
ENDIF(WIN32)
IF(UNIX)
# ADD_DEFINITIONS(-fvisibility=hidden) # This flag should be present... man gcc
ADD_DEFINITIONS(-g)
ADD_DEFINITIONS(-fnon-call-exceptions)
ADD_DEFINITIONS(-DTARGET_OS_Linux)
ADD_DEFINITIONS(-DTARGET_ARCHITECTURE_i386)
ADD_DEFINITIONS(-DTARGET_COMPILER_GCC)
ENDIF(UNIX)
# -----------------------------
# Install files
# -----------------------------
INSTALL(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
#INSTALL(DIRECTORY src/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "doc" EXCLUDE)
/**
* \page BoxAlgorithm_ClassifierProcessor Classifier processor
__________________________________________________________________
Detailed description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Description|
The <em>Classifier Processor</em> box is a generic box for classification purpose. It works
in cunjunction with the \ref Doc_BoxAlgorithm_ClassifierTrainer box.
This box' role is to expose a generic interface to the rest of the BCI pipelines. The tasks
specific to a given classifier are forwarded to one of the registered \c OVTK_TypeId_ClassifierAlgorithm
algorithms. The behavior is simple, at initialization phase, the classification algorithm 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 class is sent 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
depedendent on the choosen classification algorithm. For example, the LDA classifier sends the hyperplane distance
value as its status.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Description|
__________________________________________________________________
Inputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Inputs|
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Inputs|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Input1|
This input should be connected to the feature vectors 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.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Input1|
__________________________________________________________________
Outputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Outputs|
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Outputs|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Output1|
This output will contain the classification stimulations. Each time a new feature vector arrives to this box,
a new classification process is triggered, resuling int the generation of the corresponding class stimulation.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Output1|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Output2|
This output reflects the classification algorithm status in the form of a matrix of value. The content of this
matrix is dependent of the choosen classification algorithm. For example, the LDA classifier sends the hyperplane
distance as its status. Given that this value is dependent of the choosen algorithm, you should be very carefull
with the use of this output stream. Unexepected behavior may (will) occur when changing the classifier.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Output2|
__________________________________________________________________
Settings description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Settings|
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Settings|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Setting1|
The first setting of this box is the classifier to use. You have to choose the same classifier as the one you used
during the training phase with the \ref Doc_BoxAlgorithm_ClassifierTrainer box.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Setting1|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Setting2|
This setting points to the configuration file of the algorithm. This configuration file is generally generated from the
\ref Doc_BoxAlgorithm_ClassifierTrainer box. Its syntax depends on the selected algorithm.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Setting2|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Setting3|
For classification algorithms that support rejection, you can choose a stimulation that reflects the feature vectore
could not be classified.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Setting3|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Setting4|
This is the stimulation to send when the classifier algorithm detects a class-1 feature vector
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Setting4|
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Setting5|
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Setting5|
__________________________________________________________________
Examples description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_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 <b>motor imagary</b>
BCI scenario in the sample scenarios.
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Examples|
__________________________________________________________________
Miscellaneous description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierProcessor_Miscellaneous|
* |OVP_DocEnd_BoxAlgorithm_ClassifierProcessor_Miscellaneous|
*/
/**
* \page BoxAlgorithm_ClassifierTrainer Classifier trainer
__________________________________________________________________
Detailed description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Description|
The <em>Classifier Trainer</em> box is a generic box for classification training purpose. It works
in cunjunction with the \ref Doc_BoxAlgorithm_ClassifierProcessor box.
This box' role is to expose a generic interface to the rest of the BCI pipelines. The tasks
specific to a given classifier are forwarded to one of the registered \c OVTK_TypeId_ClassifierAlgorithm
algorithms. The behavior is simple, the box collects a number of feature vectors. Those feature vectors
are labelled depending on the input they arrive on. When a specific stimulation arrives, a training
process is triggered. This process can take some time so this box should be used offline. Depending on the
settings you enter, you will be able to perform a k-fold test in order to train a better classifier. When
this training stimulation is received, the box requests the selected classification algorithm to generate
a configuration file that will be useable online by the \ref Doc_BoxAlgorithm_ClassifierProcessor box. Finally, the box releases a particular stimulation (OVTK_StimulationId_TrainCompleted) on its ouput, that can be used to trigger further treatments in the scenario.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Description|
__________________________________________________________________
Inputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Inputs|
This box can have a variable number of inputs. If you need more than two classes, feel free to add more
inputs and to use a classifier algorithm able to classify more than two classes.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Inputs|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Input1|
The first input receives a stimulation stream. Only one stimulation of this stream is important, the one
that triggers the training process. When this stimulation is received, all the feature vectors are labelled
and sent to the classification algorithm. The training is triggered and executed. Then the classification
algorithm generates a configuration file that will be used online by the \ref Doc_BoxAlgorithm_ClassifierProcessor box.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Input1|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Input2|
This input receives the feature vector for the first class.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Input2|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Input3|
This input receives the feature vector for the second class.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Input3|
__________________________________________________________________
Outputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Outputs|
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Outputs|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Output1|
The stimulation OVTK_StimulationId_TrainCompleted is raised on this output when the classifier trainer has finished its job.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Output1|
__________________________________________________________________
Settings description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Settings|
The number of settings of this box can vary depending on the classification algorithm you choose. Such algorithm
could have specific input OpenViBE::Kernel::IParameter objects (see \ref OpenViBE::Kernel::IAlgorithmProxy for details). If
the type of those parameters is simple enough to be handled in the GUI, then additional settings will be added to this box.
For this to be applied, you will have to close & reopen the settings configuration dialog after the actual classification
algorithm is choosen. Supported parameter types are : Integers, Floats, Enumeations, Booleans. The documentation for those
parameters can not be done in this page because it is impossible to know at this time what classifier thus what hyper
parameters you will have available. This will depend on the classification algorihtms that are be implemented in OpenViBE.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Settings|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Setting1|
The first setting of this box is the classifier to use. You can choose any registered \c OVTK_TypeId_ClassifierAlgorithm
algorithm you want.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Setting1|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Setting2|
This setting points to the configuration file where to save the result of the training for later online use. This
configuration file is used by the \ref Doc_BoxAlgorithm_ClassifierProcessor box. Its syntax
depends on the selected algorithm.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Setting2|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Setting3|
This is the stimulation to consider to trigger the training process.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Setting3|
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Setting4|
If you want to perform a k-fold test, you should enter something else than 0 or 1 here. A k-fold test generally allows
better classification rates. The idea is to divide the set of feature vectors in a number of partitions. The classification
algorithm is trained on some of the partitions and its accuracy is tested on the others. The classifier with the best results
is selected as the trained classifier. See the miscellaneous section for details on how the k-fold test is done in this box.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Setting4|
__________________________________________________________________
Examples description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_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_ClassifierProcessor, please see the <b>motor imagary</b>
BCI scenario in the sample scenarios.
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Examples|
__________________________________________________________________
Miscellaneous description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ClassifierTrainer_Miscellaneous|
In this section, we will detail how the k-fold test is implemented in this box. For the k-fold test to be performed, you
have to choose more than 1 partition in the related settings. Suppose you chose \c n partitions. Then when trigger stimulation
is received, the feature vector set is splitted in \c n consecutive segments. The classification algorithm is trained on
\c n-1 of those segments and tested on the last one. This is performed for each segment. Then the classifier with the
best accuracy is choosen.
For example, suppose you have 5 parititions of feature vectors (\c FVs)
\verbatim
+------+ +------+ +------+ +------+ +------+
| FVs1 | | FVs2 | | FVs3 | | FVs4 | | FVs5 |
+------+ +------+ +------+ +------+ +------+
\endverbatim
For the first training, a feature vector set is built form the \c FVs2, \c FVs3, \c FVs4, \c FVs5. The classifier algorithm
is trained on this feature vector set. Then the classifier is tested on the \c FVs1 :
\verbatim
+------+ +---------------------------------+
| FVs1 | | Training Feature Vector Set 1 |
+------+ +---------------------------------+
\endverbatim
Then, a feature vector set is built form the \c FVs1, \c FVs3, \c FVs4, \c FVs5. The classifier algorithm
is trained on this feature vector set. Then the classifier is tested on the \c FVs2 :
\verbatim
+------+ +------+ +------------------------+
|Traini| | FVs2 | |ng Feature Vector Set 2 |
+------+ +------+ +------------------------+
\endverbatim
The same process if performed on all the partitions :
\verbatim
+---------------+ +------+ +---------------+
|Training Featur| | FVs3 | |e Vector Set 3 |
+---------------+ +------+ +---------------+
+------------------------+ +------+ +------+
|Training Feature Vector | | FVs4 | |Set 4 |
+------------------------+ +------+ +------+
+---------------------------------+ +------+
| Training Feature Vector Set 5 | | FVs5 |
+---------------------------------+ +------+
\endverbatim
Important things to consider :
- The more partitions you have, the more feature vector you have in your training sets... and the less examples you'll have to
test on. This means that the result of the test will probably be less reliable. But you will be able to choose the best classifier
among a more consequent list.
- The less partitions you have, the less feature vector you have in your training sets... and the more examples you'll have to
test on. This means that the online use of the trained classifier is more likely to be consistent with the trained classifier accuracy.
In conclusion, be carefull when choosing this k-fold test setting. Typical value range from 4 partitions (train on 75% of the feature vectors and
test on 25% - 4 times) to 10 partitions (train on 90% of the feature vectors and test on 10% - 10 times).
* |OVP_DocEnd_BoxAlgorithm_ClassifierTrainer_Miscellaneous|
*/
/**
* \page BoxAlgorithm_ConfusionMatrix Confusion Matrix
__________________________________________________________________
Detailed description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Description|
The Confusion Matrix box performs real-time computation of the confusion matrix of a given classifier.
Confusion matrix can be used to measure the performance of a classifier.
The confusion matrix output can be filled with either percentages or values. Optionnal colum and row can be added to
give the sums of each row and column.
The confusion matrix output can be displayed usig a \ref BoxAlgorithm_MatrixDisplay.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Description|
__________________________________________________________________
Inputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Inputs|
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Inputs|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Input1|
The stimulations that comes from the instruction flow, i.e. the targets that the classifier aims at.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Input1|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Input2|
The classification results coming from a classifer. These stimulations will be compared to teh target to perform the computation.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Input2|
__________________________________________________________________
Outputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Outputs|
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Outputs|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Output1|
The Confusion matrix.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Output1|
__________________________________________________________________
Settings description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Settings|
More box settings can be added for a multi class classifier. The default configuration uses 2 classes.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Settings|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Setting1|
Tells the box to put percentages or values in the matrix.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Setting1|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Setting2|
If checked, this option adds one row and one column that gives the sums of each row and column in the matrix.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Setting2|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Setting3|
The stimulation label for the first class.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Setting3|
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Setting4|
The stimulation label for the second class.
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Setting4|
__________________________________________________________________
Examples description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Examples|
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Examples|
__________________________________________________________________
Miscellaneous description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_ConfusionMatrix_Miscellaneous|
* |OVP_DocEnd_BoxAlgorithm_ConfusionMatrix_Miscellaneous|
*/
/**
* \page BoxAlgorithm_VotingClassifier Voting Classifier
__________________________________________________________________
Detailed description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Description|
The purpose of this simple classifier is to choose between multiple two class classifiers which
one mostly fits a condition. For example imagine \c n states. Each of those states can be either active
or inactive. Additionnaly, imagine you want only one active state at a time. Then you can have \c n
two-class classifiers telling for each state if it is active or not, and a following voting classifier
that chooses which of those states is the <em>most active</em>.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Description|
__________________________________________________________________
Inputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Inputs|
You can add as many inputs as you need depending on the number of preceeding states.
The inputs of this classifier can be changed to either streamed matrix of stimulations.
In the case you choose stimulations, each active stimulation gives a point
to the preceeding state. Both an inactive and a reject stimulation gives no point.
Any other stimulation is ignored.
After a number of repetitions, the state whith the best score is chossen.
In the case you choose streamed matrix, the matrix must have only one
element. This element is used as a score coefficient (in place of the simple 1-0 of the previous
case). After a number of repetitions, the state whith the best score is chossen.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Inputs|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Input1|
Input streaam for the first state.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Input1|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Input2|
Input streaam for the second state.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Input2|
__________________________________________________________________
Outputs description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Outputs|
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Outputs|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Output1|
This output sends a new stimulation as soon as the classifier received the correct number of votes
from the preceeding states. The output stimulation is based on the 5th setting of the box. First
state being selected would send exactly this stimulation. Second state would send this
stimulation + 1 etc.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Output1|
__________________________________________________________________
Settings description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Settings|
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Settings|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Setting1|
This setting tells the box how many votes it needs before choosing. If the box uses stimulations,
it must receive either the target or non target stimulation to consider a state has been voted.
Additionaly, the box waits each state to be voted the correct number of times to take a decision.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Setting1|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Setting2|
If the box uses stimulations, this settings tells what stimulation reflects that the state is active.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Setting2|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Setting3|
If the box uses stimulations, this settings tells what stimulation reflects that the state is inactive.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Setting3|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Setting4|
In case no choice can be made (for example, there are more than one state with the highest score), the
voting classifier can choose to reject the vote and send a specific stimulation for this. This is more
likely to happen when the box works on stimulation better than streamed matrix. You can force this box
to choose using the 6th setting.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Setting4|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Setting5|
This stimulation is used as a basis for the stimulations to send when a state is selected. First
state being selected would send exactly this stimulation. Second state would send this
stimulation + 1 etc.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Setting5|
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Setting6|
This setting can force the box to choose a state even if more than one state have the highest score.
In such case, there won't be any rejection. The way the box decides between the ex-aequo candidates
is undefined.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Setting6|
__________________________________________________________________
Examples description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Examples|
This box is used in the <em>P300 speller</em> and the <em>P300 magic card</em> BCIs. Please see those
scenarios in the sample <em>openvibe-scenarios</em>.
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Examples|
__________________________________________________________________
Miscellaneous description
__________________________________________________________________
* |OVP_DocBegin_BoxAlgorithm_VotingClassifier_Miscellaneous|
* |OVP_DocEnd_BoxAlgorithm_VotingClassifier_Miscellaneous|
*/
/*
\page Doc_ovpCLDAClassifier LDA classifier documentation
- Plugin name : LDA classifier
- Version : 0.5
- Author : Bruno Renier
- Date : 04-13-2007
<br>
Summary :
\ref Doc_ovpCLDAClassifier_description
\ref Doc_ovpCLDAClassifier_inputs
\ref Doc_ovpCLDAClassifier_outputs
\ref Doc_ovpCLDAClassifier_settings
\ref Doc_ovpCLDAClassifier_examples
\ref Doc_ovpCLDAClassifier_misc
<hr>
<br>
<br>
\section Doc_ovpCLDAClassifier_description Description
Classify incoming feature vectors by using the linear discriminant analysis method.
Outputs the class found and the degree of membership of the element.
\section Doc_ovpCLDAClassifier_inputs Inputs
Number of inputs : 1
-# Feature vector
- OV_TypeId_FeatureVector
- The incoming feature vectors.
\section Doc_ovpCLDAClassifier_outputs Outputs
Number of outputs : 2
-# Feature class
- OV_TypeId_StreamedMatrix
- A single element matrix containing the class found for the feature vector.
-# Amplitude
- OV_TypeId_StreamedMatrix
- A single element matrix containing the degree of membership of the feature vector in the class found.
\section Doc_ovpCLDAClassifier_settings Settings
Number of settings : 1
-# LDA parameters
- String
- Whitespace separated list of the classifier's hyperplan parameters (as real values).
\section Doc_ovpCLDAClassifier_examples Examples
\section Doc_ovpCLDAClassifier_misc Miscellaneous
*/
#ifndef _LIBSVM_H
#define _LIBSVM_H
#define LIBSVM_VERSION 291
#ifdef __cplusplus
extern "C" {
#endif
extern int libsvm_version;
struct svm_node
{
int index;
double value;
};
struct svm_problem
{
int l;
double *y;
struct svm_node **x;
};
enum { C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR