where $u(\hat y, y)$ is a utility function, e.g. $u(\hat y, y) = -(\hat y - y)^2$. The distribution $\pi$ is unknown and we estimate $U(w; \pi)$ with $$\hat U(w;\nu) = \sum_{k = 1}^K \frac{\nu_k}{n_k}\sum_{i=1}^{n_k} u(\hat Y_w(x_{i,k}), y_{i,k}).
\label{eq:U-est}$$

The weights $\nu_k\geq 0$, $\sum_k \nu_k = 1$, are user-specified and are designed to capture the relation between the target $\pi$ and the set of distributions $P_1,\ldots , P_K$. In this paper, we are interested in generalist prediction, which corresponds to $\nu_k = \frac{1}{K}$, for $k = 1, \ldots, K$, and specialist prediction, which corresponds to $\nu_k=1$ for study $k$ in $1, \ldots , K$ and 0 for the remaining $K - 1$ studies.

Generalist prediction
---------------------

The target distribution $\pi$ coincides with a future sequence of heterogeneous studies $K + 1, K + 2, \ldots$, and the utility of a generalist prediction function $\hat Y_w$ can be represented as $$U_g(w) = \lim_{I\to\infty}I^{-1}\sum_{i=1}^I U(w;P_{K+i}).$$ where the subscript $g$ reminds us that the limit is taken in the generalist case. We will consider scenarios where the above limit is well defined for any $w \in W$ with probability 1. If $P_1,P_2,\ldots$, are exchangeable, i.e. there exists $Q$ such that $P_k|Q\overset{iid}{\sim} Q, k 