Joao Barbon commited on
Commit
1514dde
1 Parent(s): 103491f
Files changed (3) hide show
  1. app.py +33 -0
  2. model.pkl +0 -0
  3. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import joblib as jb
3
+
4
+ def predict(val_fatura, DIAS_BASE, DIAS_PLANO, DDD):
5
+ model = jb.load('model.pkl')
6
+ DDD = int(DDD)
7
+
8
+ p = model.predict_proba([[val_fatura, DIAS_BASE, DIAS_PLANO, DDD]])[0]
9
+
10
+ print(p)
11
+
12
+ return {'É inadimplente': p[0], 'Não é inadimplente': p[1] }
13
+
14
+
15
+
16
+ demo = gr.Interface(fn = predict,
17
+ inputs = ["number",
18
+ "number",
19
+ "number",
20
+ gr.Dropdown(choices = ["11", "12", "13", "14", "15", "16",
21
+ "17", "18", "19", "21", "22", "24",
22
+ "27", "28", "31", "32", "33", "34",
23
+ "35", "37", "38", "41", "42", "43",
24
+ "44", "45", "46", "47", "48", "49",
25
+ "51", "53", "54", "55", "61", "62",
26
+ "63", "64", "65", "66", "67", "68",
27
+ "69", "71", "73", "74", "75", "77",
28
+ "79", "81", "82", "83", "84", "85",
29
+ "86", "87", "88", "89", "91", "92",
30
+ "93", "94", "95", "96", "97", "98", "99"], type = "index")
31
+ ],
32
+ outputs = 'label')
33
+ demo.launch()
model.pkl ADDED
Binary file (28 kB). View file
 
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ joblib
2
+ scikit-learn