[R] Why 'gbm' is not giving me error when I change the response from numeric to categorical?
peter dalgaard
pdalgd at gmail.com
Fri Oct 4 21:35:03 CEST 2013
On Oct 4, 2013, at 21:16 , Mary Kindall wrote:
> Y[Y < mean(Y)] = 0 #My edit
> Y[Y >= mean(Y)] = 1 #My edit
I have no clue about gbm, but I don't think the above does what I think you think it does.
Y <- as.integer(Y >= mean(Y))
might be closer to the mark.
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-help
mailing list