Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ from sklearn.feature_extraction.text import TfidfVectorizer
|
|
| 4 |
from sklearn.linear_model import LogisticRegression
|
| 5 |
from sklearn.model_selection import train_test_split
|
| 6 |
from sklearn.metrics import classification_report, accuracy_score, precision_score
|
|
|
|
| 7 |
|
| 8 |
df_train = None
|
| 9 |
model = None
|
|
@@ -99,7 +100,8 @@ def export_predictions():
|
|
| 99 |
global df_predict_results
|
| 100 |
if df_predict_results is None:
|
| 101 |
return None
|
| 102 |
-
|
|
|
|
| 103 |
df_predict_results.to_excel(export_path, index=False)
|
| 104 |
return export_path
|
| 105 |
|
|
|
|
| 4 |
from sklearn.linear_model import LogisticRegression
|
| 5 |
from sklearn.model_selection import train_test_split
|
| 6 |
from sklearn.metrics import classification_report, accuracy_score, precision_score
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
df_train = None
|
| 10 |
model = None
|
|
|
|
| 100 |
global df_predict_results
|
| 101 |
if df_predict_results is None:
|
| 102 |
return None
|
| 103 |
+
# Save file locally - current working directory
|
| 104 |
+
export_path = "predictions_output.xlsx"
|
| 105 |
df_predict_results.to_excel(export_path, index=False)
|
| 106 |
return export_path
|
| 107 |
|