Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.
62,252 characters · 16 sections · 27 citation commands
Combine and conquer: model averaging for out-of-distribution forecasting
The travel behaviour modelling literature has focussed extensively on two sorts of models, namely models for inference (henceforth inference models) and models for forecasting (henceforth forecasting models). Inference models aim to understand current travel behaviour (e.g. to recover the value of travel time), while forecasting models aim to predict future travel behaviour in new settings (e.g. due to changes in transport policies, such as toll roads and fuel levies).
Inference models and forecasting models are evaluated differently by analysts. When building an inference model, the focus is on ensuring that the model generates behaviourally plausible insights into explanatory factors and their relative impacts. In contrast, when building a forecasting model, the emphasis is on the model's ability to generate accurate predictions of behaviour. Importantly, forecasting involves predicting behaviour in new settings, meaning that the models have to generalise out-of-sample. This may relate, for example, to specific combinations of time and cost that were not observed in the estimation data. In addition, some prediction settings may lie outside the range of attribute values on which the models were estimated. This could involve higher costs, longer travel times, or, more intuitively, trips over longer distances\footnote{We do not consider issues of spatial or temporal transferability Fox_Daly_Hess_Miller_2014, nor the introduction of new modes or attributes. Instead, we focus on situations where attribute levels, or combinations thereof, fall outside the distribution observed in the estimation data. Our analysis is further restricted to continuous attributes, for which the impact of new attribute levels can be evaluated based on the estimated model parameters.}. In such cases, it is important for forecasting models to also generalise out-of-distribution.
Travel behaviour analysts are increasingly interested in a more diverse set of models, covering not just econometric structures, but also models from mathematical psychology hancock2018accumulation,HANCOCK2020165, and increasingly machine learning techniques alwosheel2021did, wong2021reslogit,sfeir2022gaussian,yan2025enhancing,WANG2020234. This is especially true given the growing reliance on highly granular data on travel behaviour, for example that collected using GPS tracking liu2024enhancing,TSOLERIDIS2025105289. With the typical model evaluation approach focussing on the ability of models to replicate the behaviour in the empirical data as well as possible, it should then come as no surprise that researchers in the travel behaviour field are increasingly attracted by the comparatively good prediction performance of machine learning approaches HAGENAUER2017273.
Of course, the entire purpose of building a forecasting model is not to replicate choices that have already been made, but to make predictions for new settings. Despite the growing interest in machine learning approaches, the dominant, although not necessarily evidenced-based, view is that forecasting models with a solid behavioural underpinning, such as Random Utility Maximisation (RUM) based discrete choice models, are better equipped to predict behaviour under new settings than are models with a weak or no behaviour underpinning, such as e.g. machine learning models VANCRANENBURGH2022100340.
However, what is currently less well understood is how to value and incorporate model performance, i.e. the model fit on the empirical data, in the process of developing forecasting models. Performance on empirical (estimation) data is often taken as an indication of a model’s ability to generalise, despite evidence that more flexible models that achieve better in-sample fit do not necessarily lead to improved forecasts Fox_Daly_Hess_Miller_2014,hess2025flexibilityforesightpredictivelimitations. Moreover, when behavioural patterns in out-of-distribution settings differ from those observed in the estimation data, a good in-sample fit alone may not translate into strong out-of-distribution performance. In such cases, models with a stronger behavioural underpinning may be better suited to capturing underlying decision mechanisms and could therefore generalise more robustly to new scenarios.
The contribution of this paper is twofold. First, we aim to shed light on the prediction performance of forecasting models with varying levels of behavioural underpinning as a function of the “distance” between the training data and forecasting scenarios for models. Second, we develop an approach to improve prediction performance through model averaging, where different weights are assigned to different models depending on this “distance". As highlighted above, there are many ways in which prediction settings could go outside the (multi-dimensional attribute) distribution covered by the estimation data. The focus of our work is on values of continuous attributes. We specifically use trip distance for this. It is a natural way of defining the context of a trip, and other key variables such as travel times and cost would be correlated with distance, thus also going out-of-distribution for trips that are longer or shorter than those included in the estimation data. There are also policy-relevant motivations for using distance as an example. In particular, forecasting behaviour beyond the range of observed trip distances is of interest in settings where long-distance trips are underrepresented in estimation data. While we use trip distance as the primary variable, the proposed approach is conceptually general and could be applied to other attributes that extend beyond the range observed in the estimation data. Assessing its performance in such settings is left for future work.
We employ a neural network for the model averaging. This allows learning potential nonlinear relations between distance and model weights. Using the resulting model averaging structure, we aim not only to develop a flexible tool for combining models but also to gain rule-of-thumb insights for the conditions under which specific sorts of models perform best in terms of out-of-distribution forecasting.
The remainder of this paper is organised as follows. Section (ref) presents our proposed model averaging approach. This is followed by the two case studies in Section (ref), and conclusions in Section (ref).
As outlined in the introduction, the methodological novelty of the present paper is the use of model averaging for out-of-distribution prediction. In this section, we first discuss the general concept of model averaging before looking into the adaptation required for out-of-distribution prediction.
In model averaging HANCOCK2020429, which can be viewed as a form of stacking, first introduced in the seminal work of Wolpert wolpert1992stacked, which established the conceptual basis for ensemble methods combining multiple predictive models. Specifically, we first estimate $M$ different models on the data, with model $m$ giving a likelihood $L_{n,t,m}\left(\Omega_m\right)$ for the choice observed by decision maker $n$ in choice situation $t$, using a vector of estimated model parameters $\Omega_m$. Let us further define $L_{n,m}\left(\Omega_m\right)$ to be the likelihood for the entire sequence of $T_n$ choices observed for person $n$ according to model $m$.
Model averaging now combines the insights from these different models into one overall structure. The specification of the model averaging log-likelihood function depends on whether an analyst wishes the weights for individual models to be defined at the person level (i.e. $\pi_{n,m}$ for model $m$ for person $n$) or the observation level (i.e. $\pi_{n,t,m}$ for model $m$ for person $n$ in choice situation $t$). With the former, we would have:
while, with the latter, we would have:
with $T_n$ choices per person. In this notation, $\Theta$ is a vector of parameters for the model averaging model, while $\hat{\Omega}_m$ are the maximum likelihood estimates (MLE) for the vector of parameters $\Omega_m$ for model $m$.
The weights are parameterised as being a function of the person ($z_n$) and observation ($z_{n,t}$) characteristics, with parameters $\gamma_m$ estimated to capture the influence of these characteristics. In particular, we would have:
or
where an appropriate normalisation is needed for $\gamma$, typically setting $\gamma_m=0$ for one model $m$.
A reader familiar with latent class models will realise that what is described above is, in essence, a sequential latent class structure. The sequential nature of the process involves first estimating the parameters for the $M$ individual models before then keeping those parameters fixed (at $\hat{\Omega}_m$ for model $m$) and estimating weights for each model, as in Equation (ref) and (ref). In maximising the model averaging likelihood, an analyst thus, in fact, does not require the model parameters for the individual models, only the probabilities of each observed choice.
In applying the model to predict choices out-of-sample, an analyst then again requires the predicted choice probabilities from the individual models first. Let us assume that $P_{i,n,f,m}\left(\hat{\Omega}_m\right)$ is the probability of person $n$ choosing alternative $i$ in some forecast scenario $f$, according to model $m$, again calculated at the MLEs. Let us further assume that we have worked with model averaging weights at the observation level, i.e. maximising Equation (ref) to obtain MLEs for the model weights at the observation level. We can then use these parameters to calculate the model averaging weights for the forecast scenario, i.e. $\pi_{n,f,m}\left(\hat{\Theta}\right)$. The model averaging probability for choosing alternative $i$ in this new setting would then be given by:
Model averaging typically involves estimating each model on the full dataset and then computing weights based on how well each model fits for each of the data points, estimating such weights at the person or observation level. These weights can depend on decision-maker characteristics such as age, gender, and income, as well as trip characteristics such as purpose and trip distance.
In the present paper, as outlined in the introduction, we focus specifically on trip distance. This is partly a pragmatic choice, reflecting the proof-of-concept nature of our work. It allows for a straightforward definition of in-distribution and out-of-distribution settings through a simple data split, facilitating a clear assessment of the proposed model averaging approach. It should be noted that this definition of out-of-distribution prediction may favour models with relatively high bias and low variance, as such models often extrapolate more smoothly beyond the observed range bishop2006pattern.
Trip distance also has several appealing characteristics in this context. First, it is typically not included directly as an explanatory variable in the mode choice models, which instead rely on closely correlated variables such as time and cost. Second, distance provides a parsimonious way of capturing variation across trips, as it is correlated with multiple underlying attributes. This allows the model averaging structure to learn how model performance varies with trip context using a single, interpretable variable, rather than relying on a higher-dimensional set of covariates.
Training a model averaging structure where journey distance, say $d_{n,t}$ for person $n$ and trip $t$, is used as a key characteristic in Equation (ref) would allow the model to learn how different sub-models are better suited for predicting trips of specific distances within the bounds of the estimation data. However, if the individual sub-models have been estimated on the entire data, then model averaging by definition cannot gain any insights about how the performance might differ across models out-of-distribution, and thus what weights should be given to them outside the range of distances used in estimation. As a result, the weights will simply be an extrapolation based on the estimates for $\gamma_{n,t,m}$ obtained on the training data. For example, imagine that our model would find that the weight assigned to model $m$ increases with distance. If making predictions out-of-distribution, the model would follow the same trend, and for trips with distances below the lower bound of the estimation data, the weight assigned to model $m$ would decrease, while for trips with distances above the upper bound of the estimation data, the weight assigned to model $m$ would increase.
In the present paper, we propose a different approach that enables us to examine the weight assigned to individual models in out-of-distribution predictions. Again, using distance as an example, let us assume that for the available estimation data, we have minimum and maximum distances $d_{min}$ and $d_{max}$, i.e. $D_{data}=\left[d_{min},d_{max}\right]$. We would then define a narrower interval $D_{train}=\left[d_{a},d_{b}\right]$, where $d_{min}<d_{a}<d_{b}<d_{max}$. In the estimation of the individual sub-models, we then use only a subset of the range of the available data, specifically those observations where $d_{n,t}\in D_{train}$. The model averaging structure, on the other hand, will be estimated on the entire data, i.e. still maximising e.g. Equation (ref). This means that the probabilities for the individual models will be calculated for all trips in the data, but using parameters $\hat{\Omega}_m$ obtained from optimisation on only a part of the data (where $d_{n,t}\in D_{train}$). Model averaging learns the role of trip characteristics in determining which model should obtain more weight for a specific trip. These are grouped together in the vector $z_{n,t}$ in Equation (ref). By splitting the data in the way described above, we can now define new variables to be used in Equation (ref) that help characterise whether a given observation is within $D_{train}$, and if not, how far outside the training data it is located.
The above approach directly allows the model averaging procedure to learn how individual sub-models perform outside the range of distances on which they have been trained and how the weight given to each should, as a result, change the further we move away from that interval. This, in turn, then also means that after estimating the model averaging structure, predictions can be made outside the range $D_{data}$, which is of key interest in travel demand forecasting. The model averaging procedure will have learned how the weight assigned to different models changes outside the estimation data and can then apply that knowledge in out-of-distribution prediction. For example, the model averaging process might determine that models with a stronger behavioural foundation suffer a smaller drop in performance outside the estimation data and will thus gain weight in out-of-distribution prediction.
It should be clear that an analyst will need to make important trade-offs in this process. By increasing the gaps $d_{a}-d_{min}$ and $d_{max}-d_{b}$, the analyst will increase the ability of the model averaging structure to learn about out-of-distribution weights. But this will come at the cost of reducing the width of $D_{train}$ and the size of the sample used for training the individual sub-models, reducing the ability to obtain robust estimates of the influence of level-of-service variables, for example.
Hitherto model-averaging studies have primarily relied on logistic regression models, as shown in (ref), often with linear specifications. Because of this, such models are ill-equipped to capture complex relations between explanatory variables used for the model averaging and the likelihood of the model $\pi_{n,m}$. However, when it comes to out-of-distribution prediction using model-averaging, nonlinear effects, e.g., of distance, can be expected. Therefore, in this study, we propose using an MLP for the model averaging, which is much more flexible and can learn nonlinearities and interactions between explanatory variables from the data. More specifically, the MLP is trained to learn the function $g()$, which takes the model probabilities, $P_{n,m}$ and explanatory variables $Z_{n}$ to produce the model weight: \( {\pi}_{i,n,m} = g(\omega \mid P_{n,m}, z_{n}) \).
In this paper, we illustrate the performance of the proposed approach in two case studies. In what follows, we first describe the two datasets, before talking about how the data was divided for the purpose of the present paper. We then talk about the individual sub-models and the specification and estimation of the model averaging structure. We finally look at the results.
We use two different revealed preference datasets in this study, both focussing on mode choice.
The first dataset comes from a large-scale survey conducted as part of the DECISIONS project carried out by the Choice Modelling Centre at the University of Leeds calastri2020we. We specifically use the GPS tracking component of this survey, where the data used for this work corresponds to the observed mode choice behaviour. Respondents were tracked over a period of two weeks, with most trips taking place in Yorkshire.
After extensive data cleaning and data enrichment tsoleridis2022deriving, 10,990 trips made by 415 individuals remained. For each trip, individuals travelled by one of six modes: car (48%), bus (14%), rail (5%), taxi (3%), cycling (4%) or walking (26%). The data covers a wide range of trip distances, going from just under 100 metres to just under $106$ kilometres, with a mean distance of $8.2$ kilometres and a median distance of $4.5$ kilometres. It thus covers both urban trips as well as inter-city trips, for example between Leeds and York.
The attributes of the alternatives used in the models for the present paper include in-vehicle travel time, out-of-vehicle travel time, and travel cost.
The second dataset is the London mode choice data compiled by jsmic.17.00018, referred to hereafter as LPMC (London passenger mode choice).
We use a sample of $80,943$ trips made by $31,921$ individuals. This dataset contains four alternatives: walking (18%), cycling (3%), public transport (35%, grouping together bus and rail) and driving (44%, grouping together private car and taxi rides). The data again covers a wide range of trip distances, going from just under 100 metres to just over $40$ kilometres, with a mean distance of $4.6$ kilometres and a median distance of $2.8$ kilometres. This dataset covers all of London, including short-distance trips as well as journeys from one side of London to the other.
Attributes of the alternatives used in the models include in-vehicle travel time, out-of-vehicle travel time, interchanges, and travel cost, along with two sociodemographic variables, namely car ownership and driving licence status.
As outlined in the earlier discussions, our approach to model averaging relies on the idea of excluding part of the distance distribution in the training of the individual sub-models, by setting $d_{a}>d_{min}$ and $d_{b}<d_{max}$. For the purpose of testing the performance of the model averaging approach, we go one step further in our empirical work, by excluding very short and very long trips from the training of the model averaging structure as well, thus allowing us to validate the out-of-distribution performance.
Formally, we have that the range of distances in the data is given by $D_{data}=\left[d_{min},d_{max}\right]$. The range used in training the individual sub-models is given by $D_{train,sub}=\left[d_{a,sub},d_{b,sub}\right]$. Finally, the model averaging models are estimated on $D_{train,MA}=\left[d_{a,MA},d_{b,MA}\right]$. Overall, the relationship holds that $d_{min}<d_{a,MA}<d_{a,sub}<d_{b,sub}<d_{b,MA}<d_{max}$. For the purposes of our analysis, we set $d_{a,MA}$ and $d_{b,MA}$ to be at the 10$^{th}$ and 90$^{th}$ percentiles of the sample distance distribution $D_{data}$, while $d_{a,sub}$ and $d_{b,sub}$ are set at the 20$^{th}$ and 80$^{th}$ percentiles of the sample distance distribution $D_{data}$.
As outlined above, the shortest 10% and longest 10% of trips were retained for out-of-distribution testing. In both datasets, this implies that the out-of-distribution portion corresponds to the tails of the distance distribution. The upper tail is particularly extensive, covering trips between 19.52 km and 105.9 km in the DECISIONS data, and between 11.22 km and 40.1 km in the LPMC data. This represents over 80% of the distance range in the DECISIONS data and over 70% in the LPMC data. This creates a meaningful out-of-distribution setting, with inter-city trips in the DECISIONS data and cross-London trips in the LPMC data appearing exclusively in the test set, meaning that the contexts are structurally different from the estimation data.
In addition to these divisions, we further retain $20\%$ of any trips, independent of their distance, for out-of-sample test. The splitting of the sample into estimation, test (and additionally validation data for MLP and XGB) was done at the person/household level, to avoid data leakage. In other words, each person only contributed data to either the estimate data or the test data. For those individuals who contributed to the estimation data, their observations in distance segments 1 and 10 were thus not used in our analysis. The resulting division of the data is explained in Figure (ref), with the resulting sample sizes shown Table (ref). In practical work, analysts would be unlikely to not include all deciles (intervals of 10% width) in the MA estimation work; we made these decisions with a view to validating the model idea. Similarly, a real-world application would not set aside the test data, and thus also avoid deleting observations in the estimation data for trips that are in segments 1 and 10 (see the earlier point about data leakage).
The following individual models are used in our analysis, combining structures from choice modelling, mathematical psychology and machine learning. Many other model types could have been considered\footnote{A notable omission in our list is mixture models such as mixed logit or latent class. Any advantages that such models have in estimation largely/completely disappear in prediction as the random heterogeneity needs to be averaged out. The only exception comes with the use of posterior distributions, which are not applicable in the context of out-of-sample prediction.}, where we limited ourselves to this set with a view to demonstrating the potential benefit of our proposed approach.
The NL and DFT models were coded and estimated using Apollo hess_palma_apollo, while the MLP and XGB models were implemented in Python. The MLP is implemented in PyTorch pedregosa2011scikit using a custom to handle the availability conditions, while the XGBoost model is implemented directly with the xgboost package Chen:2016:XST:2939672.2939785.
For the two data-driven models, a hyperparameter grid search was conducted to optimise performance. We used a 5-fold Grouped cross-validation procedure to account for the panel structure of the data (see Table (ref)).
For MLP, the number of hidden layers and nodes per layer influences the model’s capacity to learn complex patterns, while the batch size affects the stability and efficiency of the gradient updates. The learning rate controls how quickly the model updates its weights during training, while the L2 regularisation helps prevent overfitting by penalising large weight values. Since the best-performing hyperparameters were highly similar across both datasets, we opted to use a single configuration. The best-performing configuration found was two hidden layers with 30 nodes each, a learning rate of 0.001, a batch size of 250 and an L2 regularisation strength of 0.
An important point to highlight is variability in results. Each training run of an MLP can yield slightly different outcomes. An analyst then needs to make a decision on how many training runs to use, and which of the results to retain. We trained the model 100 times using the configuration described above. If our focus at this stage was purely on prediction performance, we would concentrate on the best fitting models out of these runs. However, our objective here is also to consider diversity across model instances, and capture variability arising from different local optima and promote ensemble diversity. We thus and averaged the predictions across these 100 runs to account for this variability.
The hyperparameter ranges for the XGB model were informed by the results of hillel2021new. The hyperparameter search included the maximum tree depth, the subsample fraction, the fraction of features considered per split, regularisation strengths (L1 and L2), and the maximum delta step. Furthermore, we set the learning rate to 0.1 and used the default values for all other hyperparameters. During training, early stopping was used to control the number of boosting rounds (with a maximum set to 3000). Thus, training was stopped if adding more trees did not further improve performance (on the validation set) after 10 boosting rounds. About the hyperparameter: the maximum tree depth controls the complexity of each tree, with deeper trees allowing more detailed partitions at the risk of overfitting. The subsample fraction regulates the proportion of training samples used for each boosting round, and the feature subsampling parameter (colsample by tree) increases model robustness by introducing randomness at the feature level. L1 and L2 regularisation terms penalise overly large weights and help stabilise the model under strong regularisation. Finally, the maximum delta step restricts the weight update size, improving convergence stability in cases of unbalanced data. The optimal hyperparameters for LPMC were: Max_tree_depth = 4, Subsample_fraction = 0.8, Colsample_by_tree = 0.8, $L_1$ reg. = 10, $L_2$ reg. = 1, and max_delta_set = 1. The optimal hyperparameters for DECISIONS were: \texttt{Max_tree_depth} = 2, \texttt{Subsample_fraction} = 0.4, \texttt{Colsample_by_tree} = 0.6, \texttt{$L_1$ reg.} = 1, \texttt{$L_2$ reg.} = 20, and \texttt{max_delta_set} = 2.
As with the MLP model, we repeated the training 100 times using the optimal configuration and averaged their predictions to account for variability in the model training. This is common practice, as when training MLPs, a substantial share gets stuck in inferior solutions.
Similar to the MLP models used for training on the datasets (see Section (ref)), the MLP used for model averaging was implemented in PyTorch NEURIPS2019_9015. This implementation is required because the loss function (see Equation (ref)) involves a custom specification that cannot be readily implemented in, for example, Scikit-learn. As explanatory features, we included three distance-based variables: the raw trip distance, its logarithmic transformation, and its squared term. While in principle the linear distance alone should suffice, we found that including the logarithmic and squared transformations resulted in a small but consistent improvement in predictive performance. Figure (ref) shows the structure for our model averaging approach. As shown in the figure, the model averaging MLP only takes the trip distance features as input to predict the weights given to each sub-model. The model-averaging probability is computed as a weighted sum, combining the predictions for the trip by each sub-model and the weights assigned to each sub-model by the model-averaging MLP.
Hyperparameters were tuned using a grid search combined with five-fold cross-validation, where folds were defined at the individual (household_id) level to avoid leakage across observations from the same individual. The following parameter spaces were considered: batch size (50, 100, 250), one hidden layer with 10, 20, or 30 nodes, learning rate (0.01, 0.001, 0.0001), and L2 regularisation strength (0, 0.01, 0.05). For the DECISIONS dataset, the best-performing model has a hidden layer with 10 nodes, a batch size of 50, a learning rate of 0.01, and an L2 regularisation strength of 0. For the LPMC dataset, the best-performing model has a hidden layer with 10 nodes, a batch size of 250, a learning rate of 0.01, and an L2 regularisation strength of 0.
Using the optimal hyperparameters, we repeated the training 100 times. In contrast with the training of the individual models, our objective is now high predictive performance. We therefore retained only the top 20 per cent of models\footnote{This selection was based on the log-likelihood. For this, we used the full data, i.e.\ training and validation data, but excluded the test data.}, discarding those that became trapped in poor local maxima. This approach differs slightly from the one used for training the data-driven models, where we also repeated training 100 times but averaged predictions across all models to encourage diversity, while diversity is now captured by the different models entering the ensemble.
It should be noted that the data used to train the meta-model are the same observations used to train the base models (for distance segments 3–8). hastie2009elements argue that using the same data for training both the base models and the meta-model may lead the meta-model to assign disproportionately high weights to more complex models, as their in-sample predictions can appear overly optimistic. To mitigate this issue, they propose a stacking procedure in which the meta-model is trained on predictions generated from data not used in training the base models (often obtained via cross-validated predictions). To further facilitate comparison with the machine learning literature on stacked generalisation, Table (ref) provides a mapping between the terminology used in this paper and the standard terminology used in that literature.
While we recognise the concern about using the same for both the base models and meta-model, we deliberately refrained from implementing a stacking procedure in the main analysis in order to keep the modelling pipeline tractable. The overall framework already involves a large number of models, data partitions, hyperparameter tunings, and aggregation steps, and introducing a full cross-validated stacking procedure would substantially increase the computational and methodological complexity. Nevertheless, to assess whether this modelling choice affects our results, we conducted an additional analysis on the larger LPMC dataset in which the meta-model is trained on predictions generated from data not used to train the base models. The results of this analysis, reported in Appendix (ref), indicate that the impact on predictive performance is negligible, suggesting that the simpler procedure used in the main analysis does not materially affect the conclusions, at least in our application.
In this section, we present the empirical results for the two case studies. We first focus on the performance of the individual sub-models, comparing this across distance segments and also discussing out-of-sample performance. We then look at the results for the model averaging structure.
Table (ref) presents the performance of the different models on the estimation sample, covering distance segments (deciles) 3 to 8, as illustrated in Figure (ref).
We see that for the DECISIONS data, NL obtains a higher log-likelihood (LL) than DFT, while DFT outperforms MNL in the LPMC data. In both studies, the two machine learning approaches obtain much higher LL than NL/MNL and DFT. Proportionally, the difference is larger in the DECISIONS case study than in the LPMC one. In the former, MLP outperforms XGB, while the reverse applies for the latter. No formal statistical tests are carried out to compare the different model structures as these are not applicable to the machine learning structures.
As a next step, Figure (ref) looks at the performance of these models across the different distance segments obtained by splitting the data into deciles of the distance distribution. We do this separately for the estimation and test data. A point to note when studying these results is that for the individual models, only segments 3 to 8 were used in estimating the model parameters, but the probabilities in segments 2 to 9 for the individual models also contributed to the model averaging, as explained in Figure (ref). The values shown for segments 2 and 9 in the left two graphs in Figure (ref) thus in effect also relate to out-of-distribution validation for the individual models.
Starting with the graphs on the left, we see that, across the two datasets, the advantage for MLP and XGB that we noted at the overall level in Table (ref) apply in each of the 6 distance segments used in estimation (i.e. segments 3-8). Across the distance segments, there are no cases where XGB outperforms MLP in the DECISIONS data, or MLP outperforms XGB in LPMC (which would reverse the overall trend), but differences change in size. Meanwhile, the overall trend between DFT and NL/MNL is reversed in some cases. These findings already show that different models perform differently well across trip distances. Interestingly, while the LPMC results suggest that mode choice is easier to predict for longer trips (across segments 3-8), no clear trend emerges for the DECISIONS data.
We next turn to segments 2 and 9 in the left two graphs, giving us initial insights into out-of-distribution performance, remembering that the values shown here are the predicted probabilities for the chosen alternative, using the model parameters obtained when estimating the models on segments 3 to 8. In the DECISIONS data, we see all models perform very similarly in segment 2, while in segment 9, DFT outperforms XGB. In the LPMC models, NL and DFT perform best in segment 2, while MLP does best in segment 9, but differences are again small.
We next turn to the test results, shown in the right two graphs in Figure (ref). We first focus on segments 3-8 with a view to understanding potential overfitting to the estimation data. For the DECISIONS data, we see some evidence of improved out-of-sample (vs within-sample) performance for all models, with an average gain in per observation LL of $0.096$ for NL, $0.095$ for DFT, $0.062$ for MLP, and $0.065$ for XGB. The same happens for LPMC models, with improvements by $0.12$ for NL and DFT, $0.11$ for MLP and $0.081$ for XGB. Overall, these results do not suggest any overfitting, at least within the distribution of distances covered by the estimation data.
The findings for segments 2 and 9 on the test data largely confirm those we saw in the two graphs on the left in Figure (ref), except for MLP and XGB performing more poorly in the test data for segment 9 for the DECISIONS data. We finally turn to segments 1 and 10. From a behavioural perspective, we see that for the DECISIONS data, mode choice on very short tips is much easier to predict. For short trips in the LPMC dataset, there is a clear advantage for the behavioural models. For the longest trips (segment 10), the trend is less clear. In the DECISIONS data, MLP and XGB perform comparatively well. In the LPMC data, both data-driven models again do comparatively well, while MNL suffers a big drop.
In model averaging, data covering segments 2-9 were used, but with model parameters for the individual models estimated on segments 3-8 only (cf. discussion around Figure (ref)). Table (ref) shows the performance (in terms of LL on the estimation set) of the four individual models, alongside that of the model averaging (MA) structure. In both datasets, the MA structure clearly obtains a higher LL than any of the four individual models. It is noteworthy that this finding is robust even to variations in the performance of the individual models. In other words, the MA structure attains a similarly high log-likelihood even when one or more of the constituent models perform less well. This echoes the well-known principle in machine learning that an ensemble of weak learners can together form a strong learner. From a practical perspective, this suggests that analysts need not exhaustively optimise each individual model when developing a model-averaging framework.
The inclusion of segments 2 and 9 allows the model averaging structure to learn about out-of-distribution performance and hence guide the process of linking the weights given to individual models to the difference between the distance for that trip and the data used in estimation (i.e. segments 3 to 8). As explained in Section (ref), a flexible neural network is used to estimate this relationship, with no a priori assumptions about the functional form. The resulting relationship is illustrated in Figure (ref).
For both datasets, we see that the MA process gives almost the entire weight to MLP and XGB for any trips with a distance contained within $D_{train,sub}$, i.e. distances on which the individual sub-models were estimated (segments 3-8). In the DECISIONS data, the weight of XGB increases on shorter trips within that part of the distance distribution compared to long trips, while for longer trips, almost the entire weight goes to MLP for DECISIONS. For LPMC, all the weight goes to XGB. These findings are in line with the pattern of prediction performance obtained for individual models, as shown on the left-hand side in Figure (ref).
Once we go outside the $D_{train,sub}$ interval, the pattern changes. In both datasets, we observe that for trips with distances below $d_{a,sub}$ (i.e. segments 1&2), the weight for behavioural models increases. In the DECISIONS data, only a small share goes to NL and DFT. On the other hand, in LPMC, MNL obtains over 80% of the weight. For longer trips, i.e. above $d_{b,sub}$, NL gets the vast majority of the weight in the DECISIONS data, with DFT getting more than MLP or XGB. For LPMC, MLP retains a large weight, but this decreases while the weight for MNL and DFT increases with distance.
The final step in our analysis of results concerns the performance of the model averaging structure on the test data. Table (ref) shows the LL on the test data, covering the entire range of distances, for the four sub-models and for model averaging. As in estimation, we see that the model averaging structure obtains the highest LL. What is notable is the contrast with the results on the estimation data, i.e. Table (ref). For both datasets, the gains by model averaging over the best-performing sub-model are larger on the test data than on the estimation data.
There are two possible influences that could drive the differences between Table (ref) and Table (ref). The first of these is the potential that model averaging reduces the risk of over-fitting to the estimation data, which can be tested by comparing the performance on segments 2-9 between the estimation and test data. The second is the potential that model averaging offers improved out-of-distribution performance, which can be tested by comparing the performance on segments 1 and 10 between the sub-models and the model averaging structure.
To support this discussion, Figure (ref) shows the per observation log-likelihoods in the different segments for estimation and test. We first see that, in estimation, model averaging outperforms (or equals) the four sub-models in 6 out of 8 estimation segments for the DECISIONS data, and 7 out of 8 for the LPMC data. When we turn to the test data, model averaging performs best (or joint best) in 4 out of 10 segments for the DECISIONS data, and 5 out of 10 segments for the LPMC data. These per-segment statistics go hand in hand with the best overall LL obtained by model averaging as reported in Table (ref) and Table (ref).
We earlier raised two possible reasons why the advantages of MA might be larger on the test data than on the validation data. In relation to over-fitting to the estimation data, we see that, for all four sub-models as well as for the model averaging structure, there are segments (out of 2-9) where the per observation LL increases and segments where it decreases. No clear pattern emerges in the comparison across models and segments. Turning to the second potential reason, namely out-of-distribution performance, we observe that for the DECISIONS data, model averaging is outperformed by NL in segment 1, but obtains by far the best performance in segment 10, where its combined performance on segments 1 and 10 is higher than for any of the other models (-0.248 vs -0.252 for XGB). For the LPMC data, a similar story emerges. Model averaging is outperformed slightly by NL in segment 1, but obtains by far the best performance in segment 10. Again, overall, MA performs the best of all models when looking at segments 1 and 10 together (-0.577 vs -0.6025 for DFT).
Overall, these findings lead to the conclusion that there is little difference across the models in terms of out-of-sample performance when looking at segments 2-9. On the other hand, there is clear evidence that our model averaging approach offers benefits in terms of out-of-distribution performance, which was its intended aim.
This work has taken an important step forward in combining insights from different modelling approaches for travel demand forecasting. Specifically, we have shown that different models predict choices differently well whether we are within the ranges of the estimation data, or outside. This result is not surprising in itself but is quantified by our work.
The main contribution comes in the development of an MLP-based model averaging approach that estimates weights for different models as a function of the distance away from the estimation data. Across two different case studies looking at mode choice, we see that data-driven machine learning approaches obtain almost the entire weight when making predictions for trips in areas similar to the trips in the estimation data. However, once we move outside that area and look at out-of-distribution prediction, the model averaging approach increases the weight for the models with behavioural underpinnings, sometimes substantially so.
In terms of prediction performance, we observe that model averaging offers the best overall performance on both the estimation and test data. Crucially, this advantage is at its largest when making out-of-distribution predictions, in our case, predicting mode choice for trips whose distance is outside the range covered by the estimation data.
While the analysis focuses on predictive performance, the observed differences across model classes can be interpreted in light of their underlying structure. In particular, models with a stronger behavioural underpinning may exhibit more stable performance in out-of-distribution settings because their parameters are constrained by behavioural theory and regularity conditions. This can limit the extent to which such models capture spurious patterns or context-specific correlations present in the estimation data. In contrast, more flexible, data-driven models may achieve superior in-sample fit by capturing patterns that do not generalise, but this flexibility can lead to reduced robustness when extrapolating beyond the observed data. We emphasise that this interpretation remains tentative and is not directly tested in this study, but it provides a plausible explanation for the observed performance differences and aligns with broader discussions on the trade-off between flexibility and generalisation.
Our work relies on multiple separate models, and this clearly leads to increased complexity as well as doing nothing to address the black box nature of machine learning approaches. A contrasting approach is to make the trade-off between fit, generalisation, and interpretability more explicit at the estimation stage. Recent work has started to do so by proposing multi-objective estimation frameworks that jointly consider in-sample fit and out-of-sample predictive accuracy, thereby making it possible to explore Pareto-efficient specifications rather than selecting models on fit alone beeramoole2024multiobjective. Related work has also shown that machine learning methods can be made more behaviourally credible by embedding behavioural regularity or interpretability constraints, which may help improve robustness when moving beyond the estimation domain feng2024gradient. At the same time, the recent benchmarking literature makes clear that choice modellers are right to take the predictive strengths of machine learning seriously: across a very large empirical comparison, many ML models outperform traditional discrete choice models in prediction accuracy, even while important questions remain around transferability and uncertainty wang2024benchmark. It would therefore be unwise to disregard the strong in-sample performance that data-driven methods can deliver. Instead, our model averaging approach is motivated precisely by the idea of combining the strengths of both traditions: the behavioural interpretability and theoretical discipline of choice models, and the empirical flexibility and predictive power of machine learning methods.
There are, of course, some opportunities for further refinement. The key one relates to the fact that, in applying our proposed model averaging approach, an analyst needs to define what distribution means. In our work, we have focused on the obvious example of trip distance, for which there were pragmatic reasons, but also given that trip distance embodies key information in relation to similarity between trips. A core opportunity for future work is thus the investigation of out-of-distribution performance considering attributes besides trip distance alone, for example, going outside the range of socio-economic characteristics covered by the estimation data, or combinations of socio-economic characteristics not covered in the estimation data. Out-of-distribution could also take on a multivariate nature, thus covering multiple trip characteristics at the same time. This, however, then also necessitates care by the analyst in defining what constitutes within-distribution and out-of-distribution.
Finally, we employed an MLP as the meta-model within the model averaging framework. The literature on ensemble and stacking architectures in machine learning offers a broad range of methodological extensions that could further enhance such meta-modelling approaches shaikh2024fundamental. Future research could, for instance, investigate deep stacking networks, Bayesian ensemble formulations, or ensemble distillation methods to improve model robustness and generalisation, particularly in data-scarce settings. Furthermore, in cases where a larger number of explanatory variables are available and one wishes to understand their importance, more structured meta-models, such as a logistic regression model or hybrid models, such as TasteNet HAN2022166 can be explored.
Stephane Hess acknowledges the support of the Delft Excellence Fund, as well as the European Research Council through the advanced grant 101020940-SYNERGY. Sander van Cranenburgh acknowledges the support of the TU Delft AI Labs programme. The authors are thankful to Thomas Hancock, Tim Hillel and Georges Sfeir for comments on an earlier draft. The comments of three anonymous referees have helped us to substantially improve the paper.