How to reference Discontiguous data rows in a function? -from new user
Mostrar comentarios más antiguos
I have imported a data set to model a decision tree using fitctree function.
My overall aim is to model a training sample from the data, and predict the remainder as out-of-sample - but I want to determine out-of-sample prediction for the entire dataset, so my approach is to model 4/5 of data as training (say, rows 1-800), and record prediction for the other 1/5 (rows 801-1000).
My problem is that I then want the fitctree fucntion to use rows 1-600 AND rows 801-1000 as the training sample, so that I can record tree.predict for rows 601-800, and so on until I can record predicted values for 5 sets of test data to populate results for the entire 1000 row set.
My firt function looked similar to this: fitctree(T(1:800,2:end),T(1:800,1)) X values are in columns 2:end, and the Y values are in column 1.
Any tips would be great! Thanks!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Classification Trees en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!