Create app.py
Browse files
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'}")
|