Bio-inspired computing is an engaging area of artificial intelligence which studies how natural phenomena provide a rich source of inspiration in the design of smart procedures able to become powerful algorithms. Many of these procedures have been successfully used in classification, prediction, and optimization problems. Swarm intelligence methods are a kind of bio-inspired algorithm that have been shown to be impressive optimization solvers for a long time. However, for these algorithms to reach their maximum performance, the proper setting of the initial parameters by an expert user is required. This task is extremely comprehensive and it must be done in a previous phase of the search process. Different online methods have been developed to support swarm intelligence techniques, however, this issue remains an open challenge. In this paper, we propose a hybrid approach that allows adjusting the parameters based on a state deducted by the swarm intelligence algorithm. The state deduction is determined by the classification of a chain of observations using the hidden Markov model. The results show that our proposal exhibits good performance compared to the original version.