riyadahmadov commited on
Commit
f5ccd41
1 Parent(s): 88374c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 joblib
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
- # Load the model from the pickle file
16
- clf = joblib.load('decision_tree_model.pkl')
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):