A supervised learning approach to games