From: Ilya Narsky on 14 May 2010 12:15 Mongkut Piantanakulchai wrote: > 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 Mongkut, Prior to 10a classregtree was implemented entirely in Matlab code. As of 10a, the sub-function that finds optimal splits was re-implemented in C for speed. We do not ship this C code, and so you won't be able to add a new splitting criterion to classregtree in 10a or later. Even if you work with pre-10a classregtree, the splitting criterion is not the only thing you will need to change. classregtree was written under assumption of one value of Y per observation and this assumption is used in several places in the code. For example, what would you expect to get from EVAL or CLASSPROB methods now? If you tell us in more detail what your Y's represent and what specific splitting criterion you have in mind (is it described in some paper?), we might be able to suggest some existing Matlab functions. -Ilya
|
Pages: 1 Prev: Add points on Bode plot Next: Image processing: phase correlation |