We consider the problem of online prediction when it is uncertain what the best prediction model to use is. We develop a method called dynamic latent class model averaging, which combines a state-space model for the parameters of each of the candidate models of the system with a Markov chain model for the best model. We propose a polychotomous regression model for the transition weights to assume that the probability of a change in time depends on the past through the values of the most recent time periods and spatial correlation among the regions. The evolution of the parameters in each submodel is defined by exponential forgetting. This structure allows the 'correct' model to vary over both time and regions. In contrast to existing methods, the proposed model naturally incorporates clustering and prediction analysis in a single unified framework. We develop an efficient Gibbs algorithm for computation, and we demonstrate the value of our framework on simulated experiments and on a real-world problem: forecasting IBM's corporate revenue.