...
 
Commits (2)
......@@ -528,6 +528,30 @@ for(m in 1:nrow(models)){ for(i in 1:filter_iters){
}
}
if (models$estimation_method[m]=='GBM' & models$type[m] == "log-log"){
predictions <- NA
TF <- modeldata$modeling_group==models$modeling_group[m] & modeldata$filter_1 >= 1
error <- try(exp(predict(model, newdata=modeldata[TF,], n.trees=ntree)))
if (class(error) != "try-error"){
predictions[TF] <- try(exp(predict(model, newdata=modeldata[TF,], n.trees=ntree)))
modeldata$fitted_value <- predictions
print("Values predicted")
}
else{
if(filter_setting_1==1){
print(error)
check<- paste0("Able to estimate all models with no trimming?")
msg<- paste0("Bad: failed to predict values for ",models$model_id[m], " at trim setting 1")
integrity_checks <- rbind(integrity_checks, data.frame(check=check, outcome=msg))
print(check); print(msg); rm( msg)
next
}else{
print(paste0("Error predicting values, skipping loop."))
next
}
}
}
if(is.numeric(predictions)){
try(ho_predictions$out_of_sample_fv[ho_predictions$DOC_NO==deed] <- predictions[!is.na(predictions)])
}else{
......