def naive_bayesian_classifier(self, pop_useful, pop_useless):
        """
        Train a naive Bayesian classifier using the useful and useless populations.
        :param pop_useful: Useful population
        :param pop_useless: Useless population
        :return: Trained GaussianNB classifier
        """
        labeled_useful_solutions = []
        labeled_useless_solutions = []

        # add labels to solutions
        for individual in pop_useful:
            labeled_useful_solutions.append((individual, +1))

        for individual in pop_useless:
            labeled_useless_solutions.append((individual, -1))

        x_train = []
        y_train = []

        for i in range(len(labeled_useful_solutions)):
            x_train.append(labeled_useful_solutions[i][0])
            y_train.append(labeled_useful_solutions[i][1])

        for i in range(len(labeled_useless_solutions)):
            x_train.append(labeled_useless_solutions[i][0])
            y_train.append(labeled_useless_solutions[i][1])

        x_train = np.asarray(x_train)
        y_train = np.asarray(y_train)

        # fit the naive bayesian classifier with the training data
        model = GaussianNB()
        model.fit(x_train, y_train)

        return model

        Train a naive Bayesian classifier using the useful and useless populations.
        :param pop_useful: Useful population
        :param pop_useless: Useless population
        :return: Trained GaussianNB classifier
        
pymoo/algorithms/moo/kgb.py