Forecasting the dynamics of chaotic systems from the analysis of their output signals is a challenging problem with applications in most fields of modern science. In this work, we use a laser model to compare the performance of several machine learning algorithms for forecasting the amplitude of upcoming emitted chaotic pulses. We simulate the dynamics of an optically injected semiconductor laser that presents a rich variety of dynamical regimes when changing the parameters. We focus on a particular dynamical regime that can show ultrahigh intensity pulses, reminiscent of rogue waves. We compare the goodness of the forecast for several popular methods in machine learning, namely, deep learning, support vector machine, nearest neighbors, and reservoir computing. Finally, we analyze how their performance for predicting the height of the next optical pulse depends on the amount of noise and the length of the time series used for training. Predicting the dynamical evolution of chaotic systems is an extremely challenging problem with important practical applications. With unprecedented advances in computer science and artificial intelligence, many algorithms are nowadays available for time series forecasting. Here, we use a well-known chaotic system of an optically injected semiconductor laser that exhibits fast and irregular pulsing dynamics to compare the performance of several algorithms [deep learning, support vector machine (SVM), nearest neighbors, and reservoir computing (RC)] for predicting the amplitude of the next pulse. We compare the predictive power of such machine learning methods in terms of data requirements and the robustness toward the presence of noise in the evolution of the system. Our results indicate that an accurate prediction of the amplitude of upcoming chaotic pulses is possible using machine learning techniques, although the presence of extreme events in the time series and the consideration of stochastic contributions in the laser model bound the accuracy that can be achieved.Peer Reviewe