Page 1 of 1

Prediction with alternate dataset

Posted: 08 Aug 2022, 17:58
by mattwigway
Is it possible to use an estimated model object to predict for a new dataset (with the same schema)? In travel demand modeling we often will estimate a model using a survey dataset and then use the model to make predictions for a synthetic population. I don't see a way to specify a separate dataset in apollo_probabilities, and apollo_outOfSample seems to be only be used for cross-validation/train-test validation where a single dataset is split, not where there are separate datasets. Does Apollo have this functionality in another function I'm not aware of?

Re: Prediction with alternate dataset

Posted: 09 Aug 2022, 16:31
by stephanehess
Hi

yes, this is straightforward.

Let's say that after model estimation, you want to use a new database called data_for_prediction.

you would then use these steps:

Code: Select all

database = data_for_prediction
apollo_inputs = apollo_validateInputs()
pred=apollo_prediction(model,apollo_probabilities,apollo_inputs)
The important step is the replacement of database by a new one, and then the call to apollo_validateInputs()

Stephane