Spaces:
Runtime error
Runtime error
Commit
·
ae70b84
1
Parent(s):
1340008
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,8 @@ def dataframe(file_obj):
|
|
38 |
|
39 |
pred_df = pd.DataFrame(y_pred, columns = ['predictedFraud'])
|
40 |
#append the predictions to the original dataframe
|
41 |
-
|
|
|
42 |
print(type(pred_df))
|
43 |
print(pred_df.shape)
|
44 |
# clr = classification_report(y_test, y_pred, target_names=['Not Fraud','Fraud'])
|
@@ -46,7 +47,7 @@ def dataframe(file_obj):
|
|
46 |
return pred_df
|
47 |
|
48 |
file = gr.components.File(file_count="single", type="file", label="Fisierul CSV cu tranzactii", optional=False)
|
49 |
-
y_pred_df = gr.components.Dataframe(max_rows=20, max_cols=
|
50 |
tree_structure = gr.Image("https://imgur.com/a/dTj0c7X", label="Structura arborelui de decizie")
|
51 |
interface_csv = gr.Interface(
|
52 |
fn=dataframe,
|
|
|
38 |
|
39 |
pred_df = pd.DataFrame(y_pred, columns = ['predictedFraud'])
|
40 |
#append the predictions to the original dataframe
|
41 |
+
df_original = pd.read_csv(file_obj.name)
|
42 |
+
pred_df = pd.concat([df_original, pred_df], axis=1)
|
43 |
print(type(pred_df))
|
44 |
print(pred_df.shape)
|
45 |
# clr = classification_report(y_test, y_pred, target_names=['Not Fraud','Fraud'])
|
|
|
47 |
return pred_df
|
48 |
|
49 |
file = gr.components.File(file_count="single", type="file", label="Fisierul CSV cu tranzactii", optional=False)
|
50 |
+
y_pred_df = gr.components.Dataframe(max_rows=20, max_cols=None, overflow_row_behaviour="paginate", type="pandas", label="predictedFraud - Predictii bazate pe modelul de clasificare /n isFraud - Etichetele reale")
|
51 |
tree_structure = gr.Image("https://imgur.com/a/dTj0c7X", label="Structura arborelui de decizie")
|
52 |
interface_csv = gr.Interface(
|
53 |
fn=dataframe,
|