This research aims to enhance portfolio selection by integrating machine learning regression algorithms for predicting stock returns with various risk measures. These measures include mean-value-at-risk (VaR) variance (Var), semi-variance mean-absolute-deviation (MAD) and conditional value-at-risk (C-VaR). Addressing gaps in existing literature. Traditional methods lack adaptability to dynamic market conditions. We propose a hybrid approach optimized by genetic algorithms. The study employs multiple machine learning models. These include Random Forest, AdaBoost XGBoost, Support Vector Machine Regression (SVR) K-Nearest Neighbors (KNN) and Artificial Neural Network (ANN). These models are used to forecast stock returns. Utilizing monthly data from the Tehran Stock Exchange, the results indicate that the genetic algorithm prediction model combined with mean-VaR, Var semi-variance and MAD, produces the most efficient portfolios. These portfolios offer superior returns with minimized risk compared to other models. This hybrid strategy provides a robust and efficient method for investors aiming to optimize returns while managing risk effectively. To implement this approach successfully it is crucial to balance investments. This involves both traditional and alternative asset classes, ensuring diversification. It also capitalizes on market opportunities. Regular review and adjustment of fund allocation are essential. Maintain an optimized strategy for maximum returns and minimal risk.