Classregtree with multiple dependent variables

2 次查看(过去 30 天)
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

回答(1 个)

Ilya
Ilya 2012-10-17
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.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by