git.schokokeks.org
Repositories
Help
Report an Issue
SVMCrossVal.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
7984c76
Branches
Tags
master
SVMCrossVal.git
private
calculateDecodePerformance.m
added randomize datapoints option
Christoph Budziszewski
commited
7984c76
at 2009-03-16 20:09:44
calculateDecodePerformance.m
Blame
History
Raw
function outputStruct = calculateDecodePerformance(header,subjectStruct,svmopts) outputStruct = struct; RANDOMIZE_DATAPOINTS = header.svmrnd; timeline = header.timeline; timeline.frameShiftStart = header.frameShift.frameShiftStart; timeline.frameShiftEnd = header.frameShift.frameShiftEnd; timeline.decodeDuration = header.frameShift.decodeDuration; timeLineStart = timeline.frameShiftStart; timeLineEnd = timeline.frameShiftEnd; % for iVoxel = 1:nVoxel % rawdata = []; % for iImage = 1:length(extr); % tmp = extr(iImage); % rawdata = [rawdata tmp.dat(iVoxel)]; % end % pst{iVoxel} = calculatePST(timeline,calculatePstOpts,rawdata); % end timePointArgs.pst = subjectStruct.pst; timePointArgs.labelMap = LabelMap(header.classDef.labelCells,header.classDef.conditionCells); timePointArgs.eventList = header.classDef.eventMatrix; timePointMatrix = buildTimePointMatrix(timeline,timePointArgs); decodePerformance = []; for index = 1:timeLineEnd-timeLineStart+1 svmdata = timePointMatrix{index}(:,2:size(timePointMatrix{index},2)); svmlabel = timePointMatrix{index}(:,1); if RANDOMIZE_DATAPOINTS rndindex = randperm(length(svmlabel)); svmdata = svmdata(rndindex,:); svmlabel = svmlabel(rndindex); end decodePerformance = [decodePerformance; svm_single_crossval(svmlabel,svmdata,svmopts)]; end outputStruct.decodePerformance = decodePerformance; outputStruct.svmdata = svmdata; outputStruct.svmlabel = svmlabel; outputStruct.rawTimeCourse = subjectStruct.pst; % outputStruct.minPerformance = minPerformance; % outputStruct.maxPerformance = maxPerformance; end