Home > GVSToolbox > autoLabel.m

autoLabel

PURPOSE ^

Samuel Rivera

SYNOPSIS ^

function labels = autoLabel( featureVect )

DESCRIPTION ^

 Samuel Rivera
 Notes: auto gets labels for features usking k-means clustering

 syntax: labels = autoLabel( featureVect )

 Inputs:
   featureVect: (d by N) column vector of trials
 
 Outputs:
   labels: (1 by N) vector of all labels (0 or 1 )

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Samuel Rivera
0002 % Notes: auto gets labels for features usking k-means clustering
0003 %
0004 % syntax: labels = autoLabel( featureVect )
0005 %
0006 % Inputs:
0007 %   featureVect: (d by N) column vector of trials
0008 %
0009 % Outputs:
0010 %   labels: (1 by N) vector of all labels (0 or 1 )
0011 
0012 function labels = autoLabel( featureVect )
0013 
0014 numSamples =size(featureVect,2);
0015 
0016 featureVect = featureVect - repmat( min( featureVect,[],2), [1,numSamples]);
0017 M = max( featureVect,[],2);
0018 featureVect( M~= 0,:) = featureVect( M~= 0,:)./repmat( M(M~=0), [1,numSamples ] ); 
0019 
0020 
0021 % featureVect = featureVect - repmat( mean(featureVect,2), [1,numSamples] );
0022 % featStdev = std( featureVect, 0, 2);
0023 % featureVect( featStdev ~= 0,:) = featureVect( featStdev ~= 0,:)./repmat(featStdev(featStdev ~= 0), [1,numSamples]);
0024 
0025 
0026 labels = kmeans(featureVect',2)-1;
0027 labels = labels';
0028 
0029 
0030 
0031 
0032 
0033 
0034 
0035 
0036 
0037

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