1. A method for training a Neural Gas network having a cost function on mass spectrometric data, comprising: (a) initializing a set of prototypes, each prototype including a weight vector and a class label vector; (b) receiving a set of training mass spectrometric data points, each training data point including a data vector and a class label vector; (c) extending the cost function of the Neural Gas network by additive terms, wherein each of the terms increases with an increase in a difference between elements of class label vectors of a prototype and a training data point and decreases with an increase in the distance between the data vector of the training data point and the weight vector of the prototype; and (d) iteratively adapting the weight vectors of the prototypes such that the extended cost function is minimized.