Online Learning Algorithms For Sequence Prediction, Importance Weighted Classification, And Active Learning