A statistical learning strategy for closed-loop control of fluid flows