Walmart Inc. is using artificial intelligence to forecast how shifts in the climate will affect the price of agricultural commodities.