With the continuous growth of the national economy and the expansion of market demand, traditional finance has gradually turned to digital transformation, and the emergence of digital finance has brought new breakthroughs to the economy. With the continuous development of the times, in order to meet the needs of the market, digital finance and commercial investment are constantly integrated. Therefore, this paper selects the returns and risks of digital financial investment as the research topic, and predicts the investment returns of the five major online banks by analyzing the digital financial portfolio investment return prediction system. The machine learning algorithm is introduced to optimize the digital financial portfolio investment return prediction system. The investment return rate is predicted by the optimized digital financial portfolio investment return prediction system, and then compared with the actual investment return rate. The experimental results show that the predicted value of the traditional digital financial portfolio investment return prediction system for the online bank financial management return rate differs from the actual return rate by 1%-2%, while the predicted value range of the digital financial portfolio investment return prediction system for the online bank financial management return rate is the same as the fluctuation range of the actual return rate. From the experimental data, it can be seen that the digital financial portfolio investment return prediction system based on machine learning can effectively improve the prediction ability of the digital financial portfolio investment return prediction system, making the predicted value closer to the actual value and increasing the reliability of the prediction. This paper provides reference value for the optimization and improvement of the digital financial portfolio investment return prediction system and contributes to the development of digital finance. Keywords: