where z and m is a charge and mass of a fragment and k index represents m/z. I q k and I l k are the intensities of the query and library spectra at k. M q and M l are the largest non-zero indices of I q and I l , and M max is equal to the largest index of M q and M l . We used the weighted cosine similarity between the predicted and observed spectra as a measure of the performance of the machine learning model.