We present the results from three motor-imagery-based Brain-Computer Interface experiments. Brain signals were recorded from 8 untrained subjects using EEG, 4 using ECoG and 10 using MEG. In all cases, we aim to develop a system that could be used for fast, reliable preliminary screening in the clinical application of a BCI, so we aim to obtain the best possible classification performance in a short time. Accordingly, the burden of adaptation is on the side of the computer rather than the user, so we must adopt a machine-learning approach to the analysis. We introduce the required machine-learning vocabulary and concepts, and then present quantitative results that focus on two main issues. The first is the effect of the number of trials-how long does the recording session need to be? We find that good performance could be achieved, on average, after the first 200 trials in EEG, 75-100 trials in MEG, or 25-50 trials in ECoG. The second issue is the effect of spatial filtering-we compare the performance of the original sensor signals with that of the outputs of Independent Component Analysis and the Common Spatial Pattern algorithm, in each of the three sensor types. We find that spatial filtering does not help in MEG, helps a little in ECoG, and improves performance a great deal in EEG. The unsupervised ICA algorithm performed at least as well as the supervised CSP algorithm in all cases-the latter suffered from poor generalization performance due to overfitting in ECoG and MEG, although this could be alleviated by reducing the number of sensors used as input to the algorithm.