SharpBCI
A multi-threaded brain control interface (BCI) library in C#
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Pages
SharpBCI.AggregatePredictionPipeable Class Reference

A pipeable which aggregates received EEGEvents into an array based on the reported EEGEvent timestamp and then uses an IPredictor<EEGEvent[]> to train/classify on them. More...

Inheritance diagram for SharpBCI.AggregatePredictionPipeable:
SharpBCI.Pipeable SharpBCI.IPredictorPipeable SharpBCI.IPipeable SharpBCI.IPipeable

Public Member Functions

 AggregatePredictionPipeable (int channels, int k, double thresholdProb, EEGDataType[] types)
 
 AggregatePredictionPipeable (int channels, int k, double thresholdProb, object[] typeNames)
 
void ClearTrainingData ()
 Clears all training data stored within the predictor Essentially a reset of the entire prediction system Use between changing environments and/or participants. More...
 
void StartTraining (int id)
 Start training predictor on the EEG data from now on Should be paired w/ a StopTraining(id) call. More...
 
void StopTraining (int id)
 Stop training predictor on the EEG data from now on Should be paired w/ a StopTraining(id) call. More...
 
- Public Member Functions inherited from SharpBCI.Pipeable
void SetInput (BlockingCollection< object > newInput)
 Set the input on this IPipeable to param input Should only be used internally by Connect. More...
 
void Connect (IPipeable other)
 Connect the input of other to our output Note: mirror == false using this override. More...
 
void Connect (IPipeable other, bool mirror)
 Connect the input of other to our output and allow for control of mirror data. More...
 
virtual void Start (TaskFactory taskFactory, CancellationTokenSource cts)
 Actually start doing work (i.e., promise to eventually start pushing data to connected pipeables) More...
 
virtual void Stop ()
 Require this IPipeable to stop, blocking until actually stopped. More...
 

Public Attributes

const int ID_PREDICT = 0
 Constant used to indicate when the encapsulated predictor is actively predicting. More...
 
const int NO_PREDICTION = -1
 Constant used to indicate when the encapsulated predictor has no valid prediction. More...
 
- Public Attributes inherited from SharpBCI.Pipeable
const int DEFAULT_BUFFER_SIZE = 1000
 

Protected Member Functions

override bool Process (object item)
 Collects incoming EEGEvents (one per type), and stores them in buffer. More...
 
- Protected Member Functions inherited from SharpBCI.Pipeable
void Add (object item)
 

Detailed Description

A pipeable which aggregates received EEGEvents into an array based on the reported EEGEvent timestamp and then uses an IPredictor<EEGEvent[]> to train/classify on them.

A TrainedEvent will be pushed on to the next stage.

See Also
EEGEvent
TrainedEvent

Constructor & Destructor Documentation

SharpBCI.AggregatePredictionPipeable.AggregatePredictionPipeable ( int  channels,
int  k,
double  thresholdProb,
EEGDataType[]  types 
)
SharpBCI.AggregatePredictionPipeable.AggregatePredictionPipeable ( int  channels,
int  k,
double  thresholdProb,
object[]  typeNames 
)

Member Function Documentation

void SharpBCI.AggregatePredictionPipeable.ClearTrainingData ( )

Clears all training data stored within the predictor Essentially a reset of the entire prediction system Use between changing environments and/or participants.

Implements SharpBCI.IPredictorPipeable.

override bool SharpBCI.AggregatePredictionPipeable.Process ( object  item)
protectedvirtual

Collects incoming EEGEvents (one per type), and stores them in buffer.

If the incoming event's timestamp is new, attempt to send the buffer onto the IPredictor<EEGEvent[]> If the current trainingId is non-zero, the data will be used for training on the trainingId label If the current trainingId is zero, the data will be predicted on

See Also
Pipeable

Implements SharpBCI.Pipeable.

void SharpBCI.AggregatePredictionPipeable.StartTraining ( int  id)

Start training predictor on the EEG data from now on Should be paired w/ a StopTraining(id) call.

Parameters
id- a unique non-negative non-zero integer which identifies this trained event

Implements SharpBCI.IPredictorPipeable.

void SharpBCI.AggregatePredictionPipeable.StopTraining ( int  id)

Stop training predictor on the EEG data from now on Should be paired w/ a StopTraining(id) call.

Parameters
id- a unique non-negative non-zero integer which identifies this trained event

Implements SharpBCI.IPredictorPipeable.

Member Data Documentation

const int SharpBCI.AggregatePredictionPipeable.ID_PREDICT = 0

Constant used to indicate when the encapsulated predictor is actively predicting.

const int SharpBCI.AggregatePredictionPipeable.NO_PREDICTION = -1

Constant used to indicate when the encapsulated predictor has no valid prediction.


The documentation for this class was generated from the following file: