Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -98,20 +98,6 @@ def explain_prediction(features, prediction):
|
|
| 98 |
# ================================
|
| 99 |
# PREDICTION PIPELINE
|
| 100 |
# ================================
|
| 101 |
-
"""
|
| 102 |
-
def detect_fraud(amount, old_balance, new_balance, transactions_per_day):
|
| 103 |
-
features = np.array([
|
| 104 |
-
amount, old_balance, new_balance, transactions_per_day
|
| 105 |
-
]).reshape(1, -1)
|
| 106 |
-
|
| 107 |
-
prediction = model.predict(features)[0]
|
| 108 |
-
probability = model.predict_proba(features)[0][prediction]
|
| 109 |
-
|
| 110 |
-
explanation = explain_prediction(features[0], prediction)
|
| 111 |
-
|
| 112 |
-
return prediction, probability, explanation
|
| 113 |
-
|
| 114 |
-
"""
|
| 115 |
def detect_fraud(amount, old_balance, new_balance, transactions_per_day):
|
| 116 |
features = np.array([amount, old_balance, new_balance, transactions_per_day]).reshape(1, -1)
|
| 117 |
|
|
|
|
| 98 |
# ================================
|
| 99 |
# PREDICTION PIPELINE
|
| 100 |
# ================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
def detect_fraud(amount, old_balance, new_balance, transactions_per_day):
|
| 102 |
features = np.array([amount, old_balance, new_balance, transactions_per_day]).reshape(1, -1)
|
| 103 |
|