diff --git a/output/Gradient Boosting_classification_report.txt b/output/Gradient Boosting_classification_report.txt index c7c9834..bcb303d 100644 --- a/output/Gradient Boosting_classification_report.txt +++ b/output/Gradient Boosting_classification_report.txt @@ -2,9 +2,9 @@ Gradient Boosting Classification Report: precision recall f1-score support 0 0.93 0.91 0.92 1152 - 1 0.78 0.82 0.80 432 + 1 0.77 0.81 0.79 432 - accuracy 0.89 1584 + accuracy 0.88 1584 macro avg 0.85 0.86 0.86 1584 -weighted avg 0.89 0.89 0.89 1584 +weighted avg 0.89 0.88 0.89 1584 diff --git a/output/Gradient Boosting_confusion_matrix.png b/output/Gradient Boosting_confusion_matrix.png index e1c74a7..54badf5 100644 Binary files a/output/Gradient Boosting_confusion_matrix.png and b/output/Gradient Boosting_confusion_matrix.png differ diff --git a/output/Random Forest_classification_report.txt b/output/Random Forest_classification_report.txt index fa0b24c..c0a7b5b 100644 --- a/output/Random Forest_classification_report.txt +++ b/output/Random Forest_classification_report.txt @@ -1,10 +1,10 @@ Random Forest Classification Report: precision recall f1-score support - 0 0.93 0.93 0.93 1152 - 1 0.81 0.82 0.81 432 + 0 0.93 0.92 0.92 1152 + 1 0.79 0.81 0.80 432 - accuracy 0.90 1584 - macro avg 0.87 0.87 0.87 1584 -weighted avg 0.90 0.90 0.90 1584 + accuracy 0.89 1584 + macro avg 0.86 0.87 0.86 1584 +weighted avg 0.89 0.89 0.89 1584 diff --git a/output/Random Forest_confusion_matrix.png b/output/Random Forest_confusion_matrix.png index 9aa4863..9fd8dbe 100644 Binary files a/output/Random Forest_confusion_matrix.png and b/output/Random Forest_confusion_matrix.png differ diff --git a/sentiment_analysis.py b/sentiment_analysis.py index a4d8fbd..888f3cf 100644 --- a/sentiment_analysis.py +++ b/sentiment_analysis.py @@ -74,5 +74,6 @@ best_pipeline.fit(df['tweet'], df['label']) -joblib.dump(best_pipeline, os.path.join(output_dir, 'best_model.pkl')) + +joblib.dump(best_pipeline, 'best_model.pkl') print(f'The best model is {best_model_name} with accuracy {results[best_model_name]}')