Regression methods based in Machine Learning Algorithms (MLA) have become an important tool for data analysis in many different disciplines. In this work, we use MLA in an astrophysical context; our goal is to measure the mean longitudinal magnetic field in stars (H_ eff) from polarized spectra of high resolution, through the inversion of the so-called multi-line profiles. Using synthetic data, we tested the performance of our technique considering different noise levels: In an ideal scenario of noise-free multi-line profiles, the inversion results are excellent; however, the accuracy of the