In portfolio analysis, the traditional approach of replacing population moments with sample counterparts may lead to suboptimal portfolio choices. I show that optimal portfolio weights can be estimated using a machine learning (ML) framework, where the outcome to be predicted is a constant and the vector of explanatory variables is the asset returns. It follows that ML specifically targets estimation risk when estimating portfolio weights, and that "off-the-shelf" ML algorithms can be used to es...