Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,9 @@ def infer(seed):
|
|
72 |
|
73 |
data = data.round(decimals = 2)
|
74 |
|
75 |
-
return f"{round(pred.flatten()[0]*100,
|
|
|
|
|
76 |
|
77 |
# get the inputs
|
78 |
inputs = [gr.Slider(minimum=0, maximum=3000, step=1, label='Choose a random number', value=5)]
|
@@ -87,7 +89,7 @@ output = [
|
|
87 |
]
|
88 |
|
89 |
title = 'Imbalanced Classification with Tensorflow'
|
90 |
-
description = 'Imbalanced
|
91 |
|
92 |
article = "Author: <a href=\"https://huggingface.co/geninhu\">Nhu Hoang</a>. Based on this <a href=\"https://keras.io/examples/structured_data/imbalanced_classification/\">keras example</a> by <a href=\"https://twitter.com/fchollet\">fchollet.</a> HuggingFace Model <a href=\"https://huggingface.co/keras-io/imbalanced_classification\">here</a> "
|
93 |
|
|
|
72 |
|
73 |
data = data.round(decimals = 2)
|
74 |
|
75 |
+
#return f"{round(pred.flatten()[0]*100, 5)}%", data.values.tolist()
|
76 |
+
result = 'This is fraudulent transaction!' if pred.flatten()[0] > 0.5 else "This is real transaction!"
|
77 |
+
return result, data.values.tolist()
|
78 |
|
79 |
# get the inputs
|
80 |
inputs = [gr.Slider(minimum=0, maximum=3000, step=1, label='Choose a random number', value=5)]
|
|
|
89 |
]
|
90 |
|
91 |
title = 'Imbalanced Classification with Tensorflow'
|
92 |
+
description = 'Imbalanced Classification in predicting Credit card Fraud.'
|
93 |
|
94 |
article = "Author: <a href=\"https://huggingface.co/geninhu\">Nhu Hoang</a>. Based on this <a href=\"https://keras.io/examples/structured_data/imbalanced_classification/\">keras example</a> by <a href=\"https://twitter.com/fchollet\">fchollet.</a> HuggingFace Model <a href=\"https://huggingface.co/keras-io/imbalanced_classification\">here</a> "
|
95 |
|