MATLAB question

7 views
Skip to first unread message

Vijayakumar Raju

unread,
Jan 27, 2012, 3:19:56 PM1/27/12
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.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages