Learning good actions to take