A system for predicting binding energy relating to a binding of a protein and a ligand, wherein the protein is an MHC class II molecule, the system comprising: a prediction component configured to predict the binding energy by employing information about the protein's sequence, the ligand's sequence and a trained binding model, the trained binding model comprising a hidden variable representing an unknown alignment of the ligand with the protein at a binding site of the protein, wherein the trained binding model further comprises trained Major Histocompatibility Complex, MHC, specific weights, trained pairwise contact potentials and a trained soft step function, the trained MHC specific weights, the trained pairwise contact potentials and the trained soft step function having been determined by minimizing an error between a predicted binding energy using the binding model and a measured binding energy, wherein predicting the binding energy further comprises estimating a probability distribution q ( m, l) that relates to a geometric configuration of the ligand bound to the protein from the training data, wherein the probability distribution is effectively determined by the model's energy predictions, wherein m represents a geometry of a configuration of amino acids at the binding site of the protein, and I is the hidden variable representing the unknown alignment of the ligand with the protein at the binding site; and iteratively re-estimating the MHC specific weights, the pairwise contact potentials and the trained soft step function and the probability distribution until convergence to determine the trained MHC specific weights, the trained pairwise contact potentials and the trained soft step function. a prediction component configured to predict the binding energy by employing information about the protein's sequence, the ligand's sequence and a trained binding model, the trained binding model comprising a hidden variable representing an unknown alignment of the ligand with the protein at a binding site of the protein, wherein the trained binding model further comprises trained Major Histocompatibility Complex, MHC, specific weights, trained pairwise contact potentials and a trained soft step function, the trained MHC specific weights, the trained pairwise contact potentials and the trained soft step function having been determined by minimizing an error between a predicted binding energy using the binding model and a measured binding energy, wherein predicting the binding energy further comprises estimating a probability distribution q ( m, l) that relates to a geometric configuration of the ligand bound to the protein from the training data, wherein the probability distribution is effectively determined by the model's energy predictions, wherein m represents a geometry of a configuration of amino acids at the binding site of the protein, and I is the hidden variable representing the unknown alignment of the ligand with the protein at the binding site; and iteratively re-estimating the MHC specific weights, the pairwise contact potentials and the trained soft step function and the probability distribution until convergence to determine the trained MHC specific weights, the trained pairwise contact potentials and the trained soft step function.