Vijayakumar Raju
unread,Jan 27, 2012, 3:19:56 PM1/27/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ml_chalmers
Hi,
for the cross validation,
i split the x into k equal parts and i use the k-1 for training and
the last part for testing.
Each time i use different training sets and a testing set.
And i have to split the training set into class1 and class2.
I tried to use x(y==-1,:) to get the class2 rows, but i'm getting the
below error.
Am new to MATLAB, can anyone provide some hints.
here, x has 1000 rows in class1 and 800 rows in class2.
>> k = x(1:1800,1:3);
>> k(y==-1,:);
Index exceeds matrix dimensions. (problem is getting the class2 rows)
but k(y==1,:) returns 1000x3 matrix.