Optimal Sub-sampling with Influence Functions