A machine learning approach for forecasting hierarchical time series