Carcass weight prediction is vital for the optimization of beef production processes, which allows for improved profitability of producers and meat processing plants. This study presents the XGBoost-CW machine learning algorithm for predicting Angus carcass weight while still alive in feedlots. Data were collected from four commercial feedlots in Argentina, which consisted of 908 British Angus cattle. The data were used to train and test six machine learning algorithms, such as Random Forest, Gradient Boosting, AdaBoost, Support Vector Machine, Decision Tree, and the proposed XGBoost-CW. The analysis included R2 (coefficient of determination) and mean square error (MSE) evaluation before and after hyperparameter optimization. The results show that XGBoost-CW outperformed, achieving an optimized MSE of 37.45 and an R2 of 0.9603, outperforming the other algorithms. This study demonstrates the potential of XGBoost-CW to improve efficiency and profitability in beef production by enabling accurate and early predictions of carcass weight, thus facilitating operational planning and better decision-making.