A successful interpretation of data goes through discovering crucial relationships between variables. Such a task can be accomplished by a Bayesian network. The dark side is that, when lots of variables are involved, the learning of the network slows down and may lead to wrong results. In this study, we demonstrate the feasibility of applying an existing Particle Swarm Optimization (PSO)-based approach to feature selection for filtering the irrelevant attributes of the dataset, resulting in a fine Bayesian network built with the K2 algorithm. Empirical tests carried out with real data coming from the bioinformatics domain bear out that the PSO fitness function is in a straight concordance to the most widely known validation measures for classification.