Computational Theory of Incremental and Active Learning for Optimal Generalization