Learning how to take risks