Optimal Subsampling with Influence Functions