Funding a loan using reinforcement learning