I am trying to use spline transformation(bs function) in the boosting algorithm in R. (gbm function). However, when I write the following code it throws me an error:
gbm(as.integer(cancel) ~ bs(log_tenure), data = train, distribution = "bernoulli")
Error in data.matrix(x) : number of items to replace is not a multiple of replacement length
Is there any way I can use spline transformations in gbm function in R?