Classregtree with multiple dependent variables
2 views (last 30 days)
Show older comments
I am trying to use classregtree with a set of independent variables among which are dummy variables and categorical ones,I can not perform the regression tree except for only one variable and it has to be numeric (It is my first time on Matlab) Could anybody please help me Thanks
0 Comments
Answers (1)
Ilya
on 17 Oct 2012
Your title says "multiple dependent variables", and your question says "a set of independent variables". Do you have multiple dependent variables or multiple independent variables or both?
classregtree can only handle scalar response. That is, you must pass Y to classregtree(X,Y) as a vector with one value per observation (row) in X. If you have multiple response values per observation, you can't use classregtree.
You must pass X as an N-by-P matrix for N observations and P variables. X must be numeric. If you have categorical variables, code them as integers and use 'categorical' parameter to tell classregtree the indices of columns in X that have these categorical variables. You do not need to "dummify" your variables - classregtree will do it for you.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!