Beauchamp:TensorECOG: Difference between revisions
Kelly Geyer (talk | contribs) |
Kelly Geyer (talk | contribs) |
||
Line 22: | Line 22: | ||
Install the package with the commands | Install the package with the commands: | ||
<code> | <code> | ||
% Install RHOPLS package | % Install RHOPLS package | ||
Line 28: | Line 28: | ||
addpath(pwd); | addpath(pwd); | ||
savepath; | savepath; | ||
% Install required toolboxes | % Install required toolboxes | ||
rhopls_setup(); | rhopls_setup(); |
Revision as of 11:15, 21 June 2017
Template:PAGE UNDER CONSTRUCTION
Regularized Higher-Order Partial Least Squares Analysis for ECoG Data
By Frederick Campbell and Kelly Geyer, June 2017
Introduction
This page contains documentation of our MATLAB package for the tensor factorization algorithm Regularized Higher-Order Partial Least Squares (RHOPLS). This algorithm is specifically designed for electrocorticography (ECoG) data, with dimensions consisting of electrodes, epoch time, and frequency.
Current capabilities:
- Data pre-processing: multiple methods for scaling data and removing outlier trails
Upcoming capabilities:
- RHOPLS algorithm implementation
- Visualization of final factorization results, along with capabilities to view data during processing. Potential functionality for SUMA visualization
Requirements
Required Software:
- R
- MATLAB Tensor Toolbox Version 2.6
Before using this package, a user should configure
Install the package with the commands:
% Install RHOPLS package
cd(rhopls_dir);
addpath(pwd);
savepath;
% Install required toolboxes
rhopls_setup();
Processing ECoG Data for Analysis
%% PARAMETERS
% 1. data_dir: Directory containing folders (labeled as patient initials)
% 2. rhopls_dir: RHOPLS toolbox directory
% 3. patient: Patient initials, also name of folder containing patient
% data. Inside this directory are three files:
% '<patient_initials>_TFR_ao_LowFreq.m', '<patient_initials>_TFR_ao.mat',
% and '<patient_initials>_trial_labels.mat'
data_dir = '/Users/beauchamplab/Documents/kg_stuff/for_kelly';
rhopls_dir = '/Users/beauchamplab/Documents/kg_stuff/for_kelly/open-source-rhopls/rhopls_code';
patient = 'YAK';
%% Set up required paths
% Install RHOPLS package
cd(rhopls_dir);
addpath(pwd);
savepath;
% Install required toolboxes
rhopls_setup();
% Check contents of patient directory
patient_dir = fullfile(data_dir, patient);
%% Load and process ECoG data
% Import design matrix for patient k
% Create the data matrix that we use for patient k
% Description of data loaded: This is a 3-dimensional tensor
% Dimensions: (trials X label) - Fred's data
std_method = 'flatten_trials';
center = true;
scaled = true;
rm_outliers = true;
overwrite = true;
verbose = true;
[X, trial_labels, metadata] = load_patient_data(patient_dir, ...
'standardizationMethod', std_method, ...
'center', center, ...
'scaled', scaled, ...
'removeOutliers', rm_outliers, ...
'overwrite', overwrite, ...
'verbose', verbose);
ECoG RHOPLS
parameter tuning, fit model
Results
do analysis here, show plots
References
- Frederick Campbell, "Interpretable Brain Decoding for Electrocorticography Data though Regularized High Order Partial Least Squares." In progress.
- Brett W. Bader, Tamara G. Kolda and others. MATLAB Tensor Toolbox Version 2.6, Available online, February 2015. URL: http://www.sandia.gov/~tgkolda/TensorToolbox/.