Commit ·
13f5415
1
Parent(s): 1702ff1
Rename german_credit_risk/code/processed/gcrisk.py to german_credit_risk/code/processed/app.py
Browse files
german_credit_risk/code/processed/{gcrisk.py → app.py}
RENAMED
|
@@ -11,7 +11,7 @@ import gradio as gr
|
|
| 11 |
## CREATING FUNCTION
|
| 12 |
|
| 13 |
def predict_credit_worthiness(name, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22):
|
| 14 |
-
path =
|
| 15 |
greet = 'Hey, ' + name + '!'
|
| 16 |
with open(path, 'rb') as file:
|
| 17 |
model = pickle.load(file)
|
|
@@ -40,10 +40,10 @@ def predict_credit_worthiness(name, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11
|
|
| 40 |
}
|
| 41 |
prediction = model.predict([list(inputs.values())])
|
| 42 |
|
| 43 |
-
y_test = pd.read_parquet(
|
| 44 |
y_test = y_test.squeeze()
|
| 45 |
|
| 46 |
-
yhat = pd.read_parquet(
|
| 47 |
yhat = yhat.squeeze()
|
| 48 |
|
| 49 |
precision = precision_score(y_test, yhat).round(2)
|
|
|
|
| 11 |
## CREATING FUNCTION
|
| 12 |
|
| 13 |
def predict_credit_worthiness(name, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22):
|
| 14 |
+
path = 'german_credit_risk/model/model.pickle'
|
| 15 |
greet = 'Hey, ' + name + '!'
|
| 16 |
with open(path, 'rb') as file:
|
| 17 |
model = pickle.load(file)
|
|
|
|
| 40 |
}
|
| 41 |
prediction = model.predict([list(inputs.values())])
|
| 42 |
|
| 43 |
+
y_test = pd.read_parquet('german_credit_risk/data/processed/y_test.parquet')
|
| 44 |
y_test = y_test.squeeze()
|
| 45 |
|
| 46 |
+
yhat = pd.read_parquet('german_credit_risk/data/processed/yhat.parquet')
|
| 47 |
yhat = yhat.squeeze()
|
| 48 |
|
| 49 |
precision = precision_score(y_test, yhat).round(2)
|