The growth of data collection has led to a proliferation of studies and research, including the transport sector, especially in metro systems. There are few studies about the prediction of the Origin-Destination (OD) matrix, which is important to know the number of passengers on each vehicle and the routes with the most traffic. Knowing this information will allow for more efficient management of resources and adjusting timetables and services to meet demand. Moreover, most OD studies focus on short-term forecasting, however, longterm prediction models are necessary for public transport planning and design. Therefore, a model capable of generating samples and predicting them is proposed, achieving a long-term prediction of OD demand. It will start with a prior process of elimination and reconstruction of records. Subsequently, the spatial-temporal dependencies will be captured in the model of generation of origin samples to finally achieve the prediction of the destinations. For the prediction model, an innovative method for the selection of the target sample based on the probability of occurrence is proposed, which increases the accuracy of the model. Finally, the model is evaluated on a real dataset of Metro de Madrid to demonstrate its validity and universality.