When Machine Learning Boosts Sensing Performance: A Compact and Contactless Soil Moisture Sensor Example