Skip to content

Instantly share code, notes, and snippets.

@adamcone
Created June 10, 2016 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcone/c8c5770e3b1eecceb539f37616f856e6 to your computer and use it in GitHub Desktop.
Save adamcone/c8c5770e3b1eecceb539f37616f856e6 to your computer and use it in GitHub Desktop.
predict_function_full = function(test.obs){
obs.NAs = sum(is.na(test.obs))
if(obs.NAs == 0){
return(predict(M0.svm.full, test.obs[-1], probability = TRUE, na.rm = TRUE))
}
else if(obs.NAs == 1){
return(predict(M1.svm.full, test.obs[-1], probability = TRUE, na.rm = TRUE))
}
else if(obs.NAs == 7){
return(predict(M7.svm.full, test.obs[-1], probability = TRUE, na.rm = TRUE))
}
else if(obs.NAs == 8){
return(predict(M8.svm.full, test.obs[-1], probability = TRUE, na.rm = TRUE))
}
else if(obs.NAs == 10){
return(predict(M10.svm.full, test.obs[-1], probability = TRUE, na.rm = TRUE))
}
else{
return(predict(M11.svm.full, test.obs[-1], probability = TRUE, na.rm = TRUE))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment