Estimates of the atmospheric parameters of M-type stars: a machine-learning perspective