Secondly, the issue of model fit is important. If the model is underfitted, the model may be too lenient in its classification (e.g., a neural network to detect alcohols would be underfit if it classifies anything with a hydroxyl group as an alcohol, instead of accounting for carboxylic acids). Similarly, a model may be overfitted if it is too stringent in its classification (e.g., a neural network to detect alcohols would be overfit if it only detects primary alcohols). To balance between these two states, Lasso and Ridge regression terms are added to the loss function (𝐿 1 = 𝜆 1 |𝑾| and 𝐿 2 = 𝜆 2 𝑾 2 regularisation respectively). The purpose of these additions to the loss function serve to penalise the overdependence or under-reliance on individual inputs (features), therefore leading to a better model fit. With these adjustments, the partial derivates shown in equations 3.6, 3.7, and 3.8 need to be reformulated. This adjustment is important in scenarios involving many features, such as in this case, which has 270 features (each intensity in a sample's timeaveraged blank-subtracted mass spectrum is an individual feature).