Over the past two decades, machine learning has gained widespread popularity among applied researchers in economics and finance. One of the most widely used methods is the random forest, commonly applied to both classification and regression tasks. This talk focuses on regression, with the goal of producing accurate forecasts of the response variable. Whereas the standard random forest uses an equal-weighted ensemble of tree-based forecasts, we propose a more flexible weighting scheme inspired by financial portfolio selection: one that, notably, allows for negative weights. Using a benchmark collection of real-world datasets, we show that our method improves forecasting accuracy not only over the standard random forest but also over existing weighted random forest approaches. Importantly, our methodology is general and can be applied to forecast combination problems beyond tree-based methods.