I am using Vertica to make statistical prediction based on machine learning models and I have a question concerning how to give the model to the UDF function as an argument.
Let's enter into detail:
I have the following functions (simplified):
predict <- function (TrainData) {
# Load model from disc with load()
# Make predictions
}
predictFactory <- function(){
list(name=predict,udxtype = c('scalar'),...)
}
As you see, I am using the function as a scalar UDF but I have to load the model every time the function is called and that is time-consuming. I wonder whether it is possible to load the model only once and to give to the predict function as an argument. Something like this:
predict <- function (TrainData,Model) {
# Make predictions
}
predictFactory <- function(){
Model <- load(model)
list(name=predict,udxtype = c('scalar'),parameters = Model)
}
Is there any way of giving arguments to the predict function from the predictFactory function?
Thank you very much.
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
