Methods for predicting the binding affinity of peptides to the MHC have become more sophisticated in the past 5-10 years. It is possible to use computational quantitative structure-activity methods to build models of peptide affinity that are truly predictive. Two of the most useful methods for building models are Bayesian regularized neural networks for continuous or discrete (categorical) data and support vector machines (SVMs) for discrete data. We illustrate the application of Bayesian regularized neural networks to modeling MHC class II-binding affinity of peptides. Training data comprised sequences and binding data for nonamer (nine amino acid) peptides. Peptides were characterized by mathematical representations of several types. Independent test data comprised sequences and binding data for peptides of length < or = 25. We also internally validated the models by using 30% of the data in an internal test set. We obtained robust models, with near-identical statistics for multiple training runs. We determined how predictive our models were using statistical tests and area under the receiver operating characteristic (ROC) graphs (A(ROC)). Some mathematical representations of the peptides were more efficient than others and were able to generalize to unknown peptides outside of the training space. Bayesian neural networks are robust, efficient "universal approximators" that are well able to tackle the difficult problem of correctly predicting the MHC class II-binding activities of a majority of the test set peptides.