Based on the work presented in the paper submitted to MRM with the title "Machine-Learning based multi-pool Voigt fitting of CEST, rNOE and MTC components in Z-spectra". The code here presents a framework to set up and train a CatBoost-regressor to transfer a given spectral line shape from least squares(LS)-based to machine learning(ML)-based. In this code it has been done for the Lorentzian and Voigt models.
In our application to CEST Z-spectra, we used spectra with 74 saturation frequency points between -20 and 20 ppm and the targeted pools were NOE+MTC, water, amine and amide groups located at offset frequencies -2.8, 0, 2 and 3.6 ppm respectively. These should be changed to the own protocol (x_values) and targeted peaks (both number and expected positions).
If the user prefare generating a Multi-pool Lorentzian model this can be done by specifying model = 'lorentzian' when initializing a model-object from the MultiPeakModels class. Currently the LS-based fitting to generate training data only offers Lorentzian and Voigt. It is possible to skip the LS-based fitting process altogether if the user already has paired data available of spectra and the corresponding parameters based on a known spectral line shape.