0

I am trying to boost my classification tree and was trying to use the gbm package. My variables are character variables of 'N' and 'Y', so the gbm.fit brings an error that my variable "is not of type numeric, ordered, or factor." Is there a way to change how this is read without changing my variable.

Joseph Kim
  • 13
  • 2
  • 4

1 Answers1

1

No it will only accept a factor. You can wrap your target variable with as.factor(my_target_variable) in the gbm.fit call itself if you don't want to change the dataframe itself.

Jamalan
  • 482
  • 4
  • 15