You cannot alter the predict files that way as when we call it we don’t pass two models.
However, you can train two models in your fit_model function and return a vector (or list) with the models.
Then that vector gets saved and loaded and you will then have to write the logic within your predict_expected_claim and predict_premium functions to expand the vector and make the predictions accordingly.
Hi @alfarzan
Why cannot we alter the prediction file codes?
Are we also not allowed to modify the number of arguments we can pass to any other function (in model file)?
It is more a curiosity if those are kind of restrictions we have.
The only functions you are allowed to change in terms of number of arguments given are:
Any preprocessing functions you write
The save_model and load_model
The reason you cannot alter the prediction files is because our servers call on those functions directly to generate predictions by feeding them 2 arguments (your model and the data). Hence if you alter the number of required arguments your code will not be able to run.
A note on the remaining code files if you are using R and want to use something other than an .RData file to save your models:
predict.R. You will have to alter the load_model accordingly.
train.R. Similarly you will have to alter the save_model accordingly.
We are going to push an update that fixes the R issue soon!
Thank you so much for you answer, precise as always.
But are you sure it doesn’t work? I did a submission with more than one model modifying both the function in model file and the call in predict and it went good.
Did i do something “illegal”?
I can give you the number of submission if you need.
It might work, but there would be no guarantee that it will continue to do so if we change some minor details in the backend. That’s why it’s safer not to.
And yes, that would be helpful, what is the submission number?