I'm currently having an error replicating code from a project designed to use machine learning to predict risk scores (risk of non-compliance) for facilities with clean water act permits. I've made a good deal of progress implementing the code but am running into a problem and because my background is environmental science and my r knowledge is extremely rudimentary I can't understand what's going wrong. The code is directly from the project and can be found here. I run into an error 533 lines into the referenced code. The error is with the code block below and states,
Error in predict(propensity.scores$forest, newdata = propensity.model.matrix.test, :
incorrect number of dimensions
test$pscore.forest <- predict(propensity.scores$forest,
newdata = propensity.model.matrix.test,
estimate.variance = TRUE)$predictions[,1]
Any help would be much appreciated!