The Neurophysiological Biomarker Toolbox (NBT)

Back to Running a calibration session

Generating feature weights

The temporal and spatial distribution over the scalp of the ERP varies from person to person. Everyone has his/her own EEG signature. This is due to differences between subjects in the structure and function of their brains, but could also be due to differences in how the experimenter mounts the EEG net on different subjects. The BCI should take into account the EEG signature of every person, so that it can predict on which letter he/she is focusing. To do this, we use the program P300Classifier. This program generates 'feature weights' that BCI2000 will apply to the incoming EEG. Features are time bin / electrode combinations with which P300Classifier associates a weight - a number that indicates how important it is in distinguishing between ERPs following target and standard stimuli. Together, these feature weights can be loaded into BCI2000 as a parameter file.

P300Classifier tutorial

  1. Open P300Classifier by clicking on the shortcut on the desktop called 'P300Classifier.exe.lnk'. The window that appears shows 3 tabs in the left bar: Data, Parameters and Details.

  2. Load the settings we prepared by clicking Load INI file in the Data tab and double-clicking the file “P300Classifier parameters.ini” in “C:\Course Mind & Machine”. This is a file that contains the settings shown in the Parameters tab, such as the electrodes (“channels”) to use and the maximum number of features to use.
  3. To load your BCI2000 data file, click on Load training data files. Select the file in the directory where you stored it. This should be in the directory C:\Course Mind & Machine\P300data and the folder with the name of your subject (e.g., MAM16.S0009001) unless you changed it in Running a calibration session:BCI2000 tutorial part 4. The file should have the extension .dat (e.g., MAM16.S0009S001R01.dat).
  4. Click Generate feature weights to generate the feature weights. This can take up to 3 minutes, depending on how many electrodes are used and the maximum number of features.
  5. While it is running, you can watch the progress by going to the Details tab:

  6. When it is done, the Details tab will show the expected percentages of correctly predicted letters for different numbers of EpochsToAverage. This gives you an idea of how well BCI2000 will be able to make sense of you subject's EEG. If you get 80 percent or higher, this is usually a good sign.

  7. Save the feature weights to a parameter file by clicking Write *.prm file in the Data tab. Save the file to the directory in which you also saved the BCI2000 data file (e.g., the subject folder MAM16.S0009001). The file is called something like “MUDChS1_CAR_SW.prm”.
  8. Close P300Classifier

Continue to Running a spelling session

More information

Notes on the output of P300Classifier:

  • The results you get from ‘generate feature weights’ do not show you the online performance you will get with BCI2000, because the results are based on applying the feature weights to the same data from which they were extracted. If the accuracy of this ‘self-classification’ reaches 100%, this does not guarantee that you will get 100% during the online classification.
  • P300Classifier shows you a table of classification accuracies for different numbers of flashes. This does not mean that the online classification accuracy for a particular number of flashes would correspond to the accuracy mentioned in the table. This is because the accuracy could also be influenced by how long the subject is paying attention to each letter and how quickly the subject can shift his/her attention to a new letter.


You can set the following parameters by going to the parameters tab:

  • Max Model Features: this is a limit on how many features can be identified. Using too many features can cause 'overfitting': this means that the computer classifies the data too precisely, so that the classification may not generalize well to other sessions. Using too few features can cause 'underfitting', meaning it will likely not separate target ERPs from standard ERPs well enough to get good classification accuracy.
  • Penter and Premove: the p-value of the least squares regression comparing standard and target ERPs - above this value features are considered significant and are entered into the model, below this value features are considered significant and removed from the model.
  • Spatial Filter: whether to take the raw data from each electrode, or reference the data of each electrode against the common average of all electrodes (Common Average Reference).
  • Decimation Frequency: this determines the time interval of the features by decimating the EEG.
  • Channel Set: only the data of the channel indices entered here will be used for classification.
  • Response Window: the window of the ERP you want to use, for example “0 800” makes the classifier look at the data between 0 and 800 ms after stimulus onset.

The official tutorial of P300Classifier can be found on the P300Classifier user reference page.

courses/generating_classification_weights.txt · Last modified: 2016/01/20 16:52 by Klaus Linkenkaer-Hansen
The NBTwiki platform - version 2.8 - 9 May 2013
Copyright (C) 2008-2015