Reliable Thermal Monitoring of Electric Machines through Machine Learning