Home > GVSToolbox > exampleEasy.m

exampleEasy

PURPOSE ^

Example for easy use

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Example for easy use

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Example for easy use
0002 
0003 
0004 % load up data
0005 dataStruct = loadFromTable( 'exampleTable.txt' );
0006 
0007 % smooth and interpolate
0008 dataStruct = smoothTracks( dataStruct );
0009 
0010 % extract variables
0011 varParams.imageSize = [1024; 1280]; % set image size (h,width)
0012 varParams.numFixationInSeq = 5;  % keep up to 5 fixations
0013 aoiPositions = [ 20, 40;  % x1, x2
0014                  40, 80]; % y1, y2
0015 aoiRadius = 30;  % 30 pixel radius for AOI cicular region
0016 relevantAOIs = 1;  % AOI (x1,y1) is relevant AOI
0017 [ featureVect, varParams ] = extractVarsDist( dataStruct.trackCell, aoiPositions, aoiRadius, relevantAOIs, varParams );
0018 
0019 
0020 % find variables that separate
0021 numWanted = 5;
0022 [ bestVariablesLR ] = sortVariablesLR( featureVect, dataStruct.allLabels, numWanted );
0023                 
0024 [ bestVariablesBayes] = sortVariablesNB( featureVect, dataStruct.allLabels, ...
0025                 dataStruct.sampsPerSubj, numWanted );             
0026 
0027 % automatically find labels
0028 labels = autoLabel( featureVect ) ;           
0029             
0030             
0031 % output best variables
0032 describeVariables( varParams, bestVariablesLR );   
0033 
0034 % validate using classifier
0035 [ percCorrectLDA, wLDA ] = runLDALeave1Out( featureVect(bestVariablesLR,:), dataStruct.allLabels, dataStruct.sampsPerSubj );
0036 [ percCorrectLR, wLR ] = runLRLeave1Out( featureVect(bestVariablesLR,:), dataStruct.allLabels, dataStruct.sampsPerSubj );
0037 [ percCorrectSVM, wSVM  ] = runSVMLeave1Out( featureVect(bestVariablesLR,:), dataStruct.allLabels, dataStruct.sampsPerSubj );
0038 
0039 
0040 % output for analysis
0041 exportToTable( dataStruct, featureVect(bestVariablesLR,:), 'outTemp.txt' )
0042 
0043 
0044

Generated on Tue 01-Jul-2014 12:35:04 by m2html © 2005