The prediction of subject traits using brain data is an important goal in neuroscience, with relevant applications in clinical research, as well as in the study of differential psychology and cognition. While previous research has primarily focused on neuroimaging data, our focus is on the prediction of subject traits from electroencephalography (EEG), a relatively inexpensive, widely available and non-invasive data modality. However, EEG data is complex and needs some form of feature extraction for subsequent prediction. This process is almost always done manually, risking biases and suboptimal decisions. Here, we propose a largely data-driven use of the EEG spectrogram, which reflects macro-scale neural oscillations in the brain. Specifically, the key idea of this paper is to reinterpret the spectrogram as a probability distribution and then leverage advanced machine learning techniques that can handle probability distributions with mathematical rigour and without the need for manual feature extraction. The resulting technique, Kernel Mean Embedding Regression (KMER), shows superior performance to alternative methods thanks to its capacity to handle nonlinearities in the relation between the EEG spectrogram and the trait of interest. We leveraged this method to predict biological age in a multinational EEG data set, HarMNqEEG, showing the method’s capacity to generalise across experiments and acquisition setups.