From: Mongkut Piantanakulchai on
Hi,

Is it possible to modify classregtree to deal with other split criterion (especially multiple responses, Ys)

Normally, the function can handle something like this
X1,X2, ..., Xn, Y

Xs are predictors
Y is only single response variable which we know the category in advance (for example Y = 'setosa' or 'virginica' or 'versicolor' ,etc.

Suppose I have data like
X1, X2, ... Xn, Y1, Y2, ...Yn

Ys are response variables (they can be numbers) ==> categories are not defined in advance like the previous example

The splitting criterion is a user defined function f=f(Y1, Y2, ...Yn)

Is it possible to modify the code to handle the above problem?

Thank you very much in advance,

Mongkut P.

------------------------
I found that this is the area that I should start, but want to know if there are any other area in the code which I need to modify in order to make it work seamlessly?

switch(Criterion)
% Criterion function Is it an impurity measure?
% ------------------ --------------------------
case 'gdi', critfun = @gdi; isimpurity = 1;
case 'twoing', critfun = @twoing; isimpurity = 0;
case 'deviance', critfun = @deviance; isimpurity = 1;
otherwise, error('stats:treefit:BadSplitCriterion',...
'Bad value for ''splitcriterion'' parameter.')
end
From: Mongkut Piantanakulchai on
Please note that though Ys are numeric the problem is not regression tree (but classification based on Ys)
From: Tom Lane on
> Please note that though Ys are numeric the problem is not regression tree
> (but classification based on Ys)

I'm still not getting it. In your other post you indicate that the
categories are not defined in advance. Are you looking to do clustering on
the Y data, then try to create a classification tree for those clusters
based on the X data? In that case you could just perform those two steps
separately. But if not, I just don't understand what you're trying to do.

My guess is you won't be able to do it by adding another case to the switch
statement you quoted, but I'm not sure.

-- Tom


From: Mongkut Piantanakulchai on
Tom,

I can classify Ys into groups first and then apply classregtree (that's one solution I thought already. However, my question was is it possible to integrate the splitting criterion it in classregtree if I don't want to define the categories of Y in advance.

[Please see my response to Ilya, there is more explanation about the problem]