{"id":19933343,"url":"https://github.com/mishaa931/truth-guard","last_synced_at":"2026-06-05T22:31:44.336Z","repository":{"id":183059138,"uuid":"669538090","full_name":"Mishaa931/Truth-Guard","owner":"Mishaa931","description":"This repository contains code for evaluating different machine learning models for classifying fake news. The dataset used for this evaluation consists of labeled news articles as either \"REAL\" or \"FAKE\". Three popular classifiers, Support Vector Machine (SVM), Decision Tree, and Logistic Regression, are trained and evaluated on this dataset.","archived":false,"fork":false,"pushed_at":"2023-07-22T19:45:01.000Z","size":169,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T01:49:45.265Z","etag":null,"topics":["confusionmatrix","datavisualization","decisiontree","fakenewsdataset","logisticsregression","modelevaluation","nlp","svm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mishaa931.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-22T15:50:12.000Z","updated_at":"2024-08-18T16:09:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b14537ac-ac30-43c1-a429-179af2a09ac2","html_url":"https://github.com/Mishaa931/Truth-Guard","commit_stats":null,"previous_names":["mishaa931/model-evaluation-for-fake-news-classification","mishaa931/truth-guard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mishaa931%2FTruth-Guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mishaa931%2FTruth-Guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mishaa931%2FTruth-Guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mishaa931%2FTruth-Guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mishaa931","download_url":"https://codeload.github.com/Mishaa931/Truth-Guard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241361397,"owners_count":19950379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["confusionmatrix","datavisualization","decisiontree","fakenewsdataset","logisticsregression","modelevaluation","nlp","svm"],"created_at":"2024-11-12T23:13:30.655Z","updated_at":"2026-06-05T22:31:44.326Z","avatar_url":"https://github.com/Mishaa931.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Model Evaluation for Fake News Classification\n\nThis repository contains code for evaluating different machine-learning models for classifying fake news. The dataset used for this evaluation consists of labeled news articles as either \"REAL\" or \"FAKE\". Three popular classifiers, Support Vector Machine (SVM), Decision Tree, and Logistic Regression, are trained and evaluated on this dataset.\n\n## Data Preparation\nThe dataset is preprocessed to convert the raw text data into numerical feature vectors using the TF-IDF vectorization technique. The processed data is then split into training and testing sets.\n\n## Model Training and Evaluation\n### Accuracy\nThe accuracy of each model is computed on the test dataset. The accuracy scores for each model are as follows:\n- SVM Accuracy: 0.80\n- Decision Tree Accuracy: 0.71\n- Naive Bayes Accuracy: 0.81\n\n### F1 Score\nThe F1 scores for each model are calculated for both classes ('REAL' and 'FAKE'). The F1 scores for each model are as follows:\n- SVM F1 Score: [0.80, 0.81]\n- Decision Tree F1 Score: [0.72, 0.71]\n- Logistic Regression F1 Score: [0.80, 0.82]\n\n### Classification Report\nDetailed classification reports for each model are provided, including precision, recall, and F1-score for each class ('REAL' and 'FAKE'). \n\n### Confusion Matrix\nThe confusion matrices for each model are computed to visualize the true positive (TP), true negative (TN), false positive (FP), and false negative (FN) values.\n\nVisualizations\nThe evaluation results for each model are visualized using the Plotly library to create interactive charts.\n\nModel Accuracy Bar Chart\nA bar chart displays the accuracy of each model, allowing easy comparison between the classifiers.\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Mishaa931/Model-Evaluation-for-Fake-News-Classification/blob/main/Graphs/heatmap1.png\", alt=\" Model Accuracy  \" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\n\nModel F1 Score Grouped Bar Chart\nA grouped bar chart displays the F1 scores for each class ('REAL' and 'FAKE') for each model, enabling comparison of performance for both classes.\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Mishaa931/Model-Evaluation-for-Fake-News-Classification/blob/main/Graphs/heatmap2.png\", alt=\" Model F1 Score \" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\n\nConfusion Matrix Heatmaps\nInteractive heatmaps represent the confusion matrices for each model, making it easy to analyze misclassifications.\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Mishaa931/Model-Evaluation-for-Fake-News-Classification/blob/main/Graphs/heatmap3.png\", alt=\" SVM Confusion Matrix \" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Mishaa931/Model-Evaluation-for-Fake-News-Classification/blob/main/Graphs/heatmap4.png\", alt=\" Decision Tree Confusion Matrix\" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Mishaa931/Model-Evaluation-for-Fake-News-Classification/blob/main/Graphs/heatmap5.png\", alt=\" Logistics Regression Confusion Matrix\" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\nClassification Report Table\nA table presents the precision, recall, F1-score, and support for each class ('REAL' and 'FAKE') for each model.\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Mishaa931/Model-Evaluation-for-Fake-News-Classification/blob/main/Graphs/heatmap6.png\", alt=\" Classification Report\" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\n\n## Conclusion\nBased on the evaluation metrics, the Logistic Regression model appears to be the best-performing model for classifying fake news, achieving an accuracy of 81% and higher F1 scores for both classes.\n\nFeel free to explore the code and use it for your classification tasks. If you have any questions or suggestions, please feel free to contact me.\n\nHappy coding!\n\n*Note: The actual code for data preprocessing and model training is available in the Jupyter notebook 'fake_news_classification.ipynb'.Code can be provided on request*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishaa931%2Ftruth-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishaa931%2Ftruth-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishaa931%2Ftruth-guard/lists"}