AN INTELLIGENT MACHINE LEARNING FRAMEWORK FOR FAKE NEWS DETECTION USING TF-IDF FEATURE EXTRACTION AND ENSEMBLE LEARNING
Keywords:
Fake News Detection; Machine Learning; TF-IDF; XGBoost; Logistic Regression; Random Forest; Text Classification;Abstract
News moves quickly these days thanks to websites and social platforms. That rush? It brings trouble—made-up reports spreading like they’re true. Telling fact from fiction isn’t always easy anymore. Earlier efforts leaned on machines trained to tell real stories apart from fake ones. These systems often cleaned up text first, then turned words into numbers using methods such as TF-IDF before sorting them. This new research builds on earlier findings. Machine learning tools spot false stories by pulling information directly from files named Fake.csv and True.csv. Out of 44,898 entries, slightly more than half were fake—23,481 tagged as 0. Real articles made up the rest, marked with a 1. Instead of keeping them separate, the title and body text were joined into one field. Cleaning came next, stripping away messy bits from that combined content. After tidying things up, each word was transformed through TF-IDF weighting. We began with familiar steps. First, prep work. Then, the transformation of words to numbers. A learner was selected. The learner was then taught using the prepared data. Finally, we measured how well the learner had absorbed the lessons. In this version, four-fifths of the data is dedicated to the learning process, while the remaining one-fifth is reserved; it will be used for later verification checks. Fifty thousand features shaped the input space. Words alone mattered, along with pairs sitting side by side. Common fillers like "the" or "of" got dropped out early. Terms appearing too often across sources disappeared when shared by over 80 percent. Rare ones seen fewer than twice vanished too. Frequencies were carefully adjusted with logarithmic scaling to temper any overwhelming dominance. Six machine learning models underwent
thorough evaluation. Logistic Regression initiated the process, succeeded by Decision Tree, and then Random Forest. Gradient Boosting followed, with Passive Aggressive Classifier appearing before XGBoost concluded the series. Performance evaluations relied on standard metrics, though each figure offered unique insights. Training and test accuracy started us off, yet precision and recall, including F1-score, remained under scrutiny. Confusion matrices filled in what the averages missed, offering glimpses into where guesses went right. - or didn’t. Among them all, one stood apart without flash or noise. XGBoost reached a 99.86% mark when tested, not guessed, but built instead on patterns found during real trials. Its precision landed at 99.79%, showing few false alarms
Recall climbed even higher, hitting 99.91%, meaning it caught nearly all true cases thrown its way. The balance between these two settled neatly into an F1-score of 99.85%, firm and unshaken. No model ran closer. Thirteen errors stood out when XGBoost faced 8,980 test cases in the confusion matrix. Because of that, combining TF-IDF with powerful learners such as XGBoost proves effective at telling false stories apart from true ones here.












