Ecological and Evolutionary Inference using Supervised Learning