Chapter 14 Multiple choice questions

Quiz Content

not completed
. Download the data file for the multiple-choice questions for Chapter 14, and open it in R. The array ERPdata contains brain activity from an EEG experiment at a single time point, in which images were shown either on the left or right of the screen. The array has three dimensions:
• Dimension 1 indexes the location (left or right)
• Dimension 2 indexes 200 trials for each condition
• Dimension 3 indexes 64 locations on the participant's head
Use the caret package to train a linear support vector machine to classify between locations, using the first 100 trials for each condition (do not scale the data). Then test the performance of the classifier using the remaining trials. What is the classification accuracy?

not completed
. Use the binom.test function to calculate a binomial test for 200 observations, comparing the accuracy from Question 1 to 50% correct. Is the performance significantly above chance?

not completed
. Try using a radial basis function kernel instead. What happens to the accuracy?

not completed
. Which of the algorithms below produces the highest accuracy?

not completed
. Next, rescale the data separately for each condition and electrode using the scale function. How does this affect the accuracy?

not completed
. EEG data are notoriously noisy, so to improve accuracy it is common practice to average over subsets of trials. If we average over subsets of 20 trials, how many observations (averages) will there be for each condition?

not completed
. The following lines of code will average successive sets of 40 trials, and create two matrices (sampleMatrixL and sampleMatrixR), each of which contains ten averages for the appropriate condition:
ntrials <- 200
trialspersample <- 20
nsamples <- ntrials/trialspersample
sampleMatrixL <- matrix(0,nrow=nsamples,ncol=64)
sampleMatrixR <- matrix(0,nrow=nsamples,ncol=64)
for (n in 1:nsamples){sampleMatrixL[n,] <-colMeans(ERPdata[1,(1+((n-1)*trialspersample)):(n*trialspersample),])}
for (n in 1:nsamples){sampleMatrixR[n,] <-colMeans(ERPdata[2,(1+((n-1)*trialspersample)):(n*trialspersample),])}
Train a linear support vector machine algorithm using the first five averages of each condition, and calculate its accuracy using the remaining five averages for each condition. How many averages does the algorithm get correct?

not completed
. How many trials per average gives the best performance?

not completed
. Another common trick in classifying EEG data is to randomly reshuffle the trials, and repeat the classification many times. This often improves accuracy, as well as increasing the granularity of the accuracy measure. Use the sample function to randomly permute the trial order before you calculate averages of 20 trials to use in classification. Repeat the classification 100 times with different permutations, and calculate the average accuracy. It is approximately:

not completed
. Now modify the code from Question 9 so that either the first 32 or second 32 electrodes are used in the pattern analyses. Which set of electrodes gives the best classifier performance?

Back to top