Akshat747 commited on
Commit
5e7fb05
·
verified ·
1 Parent(s): f5f342e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import joblib
4
+ from huggingface_hub import hf_hub_download
5
+
6
+ path = hf_hub_download(repo_id="Akshat747/tourism-model",
7
+ filename="model.joblib",
8
+ repo_type="model")
9
+
10
+ model = joblib.load(path)
11
+
12
+ st.title("Wellness Package Purchase Predictor")
13
+
14
+ age = st.number_input("Age", 18, 100)
15
+ income = st.number_input("Monthly Income")
16
+ trips = st.number_input("Number of Trips per year")
17
+
18
+ if st.button("Predict"):
19
+ df = pd.DataFrame([[age, income, trips]],
20
+ columns=["Age","MonthlyIncome","NumberOfTrips"])
21
+ pred = model.predict(df)[0]
22
+ st.success(f"Prediction: {'Will Purchase' if pred==1 else 'Will Not Purchase'}")