I’m doing a project, on Google Colab, for fake news classification with LIAR dataset. I am running with three differents features extractors (TF-IDF, DistilBERT and LLAMA 2) and seven classifiers (Logistic Regression, SVM, Naive Bayes, KNN, Random Forest, AdaBoost and XGBoost). However, many tests gave the same result, even though they used different algorithms. Below, the values found for the average accuracy entered are listed with the standard deviation in parentheses. The cells in orange are those that showed the same result (64.15 (2.22 x 10^-16)).
This should not be happening, considering that, in addition to being different methods, I am running each experiment 30 times, varying the training and testing basis in each run. Below, an excerpt of the code, with Naive Bayes:
model_nb = GaussianNB()
grid_nb = GridSearchCV(model_nb, parameters_nb)
for i in range(30):
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size = 0.2, stratify = Y)
fit_model_nb = grid_nb.fit(X_train, y_train)
pred_nb = fit_model_nb.predict(X_test)
predictions_df = pd.DataFrame({'Predicted_Label': pred_nb, "True": y_test})
# Nomeie o arquivo com um identificador único (por exemplo, o número da iteração)
filename = f'nb_predictions_{i}.csv'
# Salve o DataFrame em um arquivo CSV com o nome único
predictions_df.to_csv(filename, index=False)
I carried out other tests with other bases, such as FakeNewsNet and KaggleFN, and this problem did not occur there. One consideration to make is that I needed to adjust the LIAR labels to be a base of binary classes, so the six classes became just two (true or false), as follows:
‘half-true’-> ‘false’, ‘barely-true’-> ‘false’, ‘pants-fire’-> ‘false’, ‘mostly-true’-> ‘true’, ‘true’-> ‘true’, ‘false’-> ‘false’
But I believe this should not impact the result.