Learning the Optimal Stopping for Early Classification within Finite Horizons via Sequential Probability Ratio Test