A Generalized Machine Learning Framework for Time Series Forecasting