rohan965 commited on
Commit
a35d154
·
verified ·
1 Parent(s): c61867b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -311,15 +311,15 @@ def predict_both(
311
  # R model prediction
312
  r_proba = _predict_r(features)
313
 
314
- py_text = f"Python (Random Forest) cancellation probability: **{py_proba:.3f}**"
315
- r_text = f"R (LASSO Logistic Regression) cancellation probability: **{r_proba:.3f}**"
316
 
317
  comp_df = pd.DataFrame(
318
- [
319
- {"model": "Python Random Forest", "p_cancel": py_proba},
320
- {"model": "R LASSO Logistic Regression", "p_cancel": r_proba},
321
- ]
322
- )
323
 
324
  return py_text, r_text, comp_df
325
 
@@ -346,7 +346,6 @@ def get_dropdown_choices():
346
 
347
  with gr.Blocks(
348
  title="Hotel Booking Cancellation Prediction",
349
- theme=gr.themes.Soft(primary_hue="blue"),
350
  css=open("style.css").read()
351
  ) as demo:
352
  gr.Markdown(
 
311
  # R model prediction
312
  r_proba = _predict_r(features)
313
 
314
+ py_text = f"Python (Random Forest) cancellation probability: **{py_proba*100:.1f}%**"
315
+ r_text = f"R (LASSO Logistic Regression) cancellation probability: **{r_proba*100:.1f}%**"
316
 
317
  comp_df = pd.DataFrame(
318
+ [
319
+ {"model": "Python Random Forest", "p_cancel_%": round(py_proba * 100, 1)},
320
+ {"model": "R LASSO Logistic Regression", "p_cancel_%": round(r_proba * 100, 1)},
321
+ ]
322
+ )
323
 
324
  return py_text, r_text, comp_df
325
 
 
346
 
347
  with gr.Blocks(
348
  title="Hotel Booking Cancellation Prediction",
 
349
  css=open("style.css").read()
350
  ) as demo:
351
  gr.Markdown(