Commit
•
f5ccd41
1
Parent(s):
88374c8
Update app.py
Browse files
app.py
CHANGED
@@ -6,14 +6,14 @@ from sklearn.model_selection import cross_val_score
|
|
6 |
import gradio as gr
|
7 |
from sklearn.decomposition import PCA
|
8 |
import json
|
9 |
-
import
|
10 |
|
11 |
# Open and read the JSON file
|
12 |
with open('fraud_mean_by_country.json', 'r') as json_file:
|
13 |
fraud_mean_by_country_dict = json.load(json_file)
|
14 |
|
15 |
-
|
16 |
-
clf =
|
17 |
|
18 |
# Predict using the decision tree classifier
|
19 |
def predict(transaction_id, customer_id, merchant_id, amount, transaction_time, card_type, location, purchase_category, customer_age, transaction_description, country):
|
|
|
6 |
import gradio as gr
|
7 |
from sklearn.decomposition import PCA
|
8 |
import json
|
9 |
+
import pickle
|
10 |
|
11 |
# Open and read the JSON file
|
12 |
with open('fraud_mean_by_country.json', 'r') as json_file:
|
13 |
fraud_mean_by_country_dict = json.load(json_file)
|
14 |
|
15 |
+
with open("decision_tree_model.pkl", "rb") as file:
|
16 |
+
clf = pickle.load(file)
|
17 |
|
18 |
# Predict using the decision tree classifier
|
19 |
def predict(transaction_id, customer_id, merchant_id, amount, transaction_time, card_type, location, purchase_category, customer_age, transaction_description, country):
|