Spaces:
Sleeping
Sleeping
Upload app (1).py
Browse files- app (1).py +31 -0
app (1).py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import joblib
|
| 4 |
+
from huggingface_hub import hf_hub_download
|
| 5 |
+
|
| 6 |
+
st.set_page_config(page_title="Tourism Predictor", page_icon="✈️")
|
| 7 |
+
|
| 8 |
+
@st.cache_resource
|
| 9 |
+
def load_model():
|
| 10 |
+
model_path = hf_hub_download("Supreeth15/tourism-model", "best_model.pkl")
|
| 11 |
+
return joblib.load(model_path)
|
| 12 |
+
|
| 13 |
+
st.title("🌍 Tourism Package Predictor")
|
| 14 |
+
st.write("Predict Wellness Tourism Package purchase")
|
| 15 |
+
|
| 16 |
+
model = load_model()
|
| 17 |
+
st.success("✅ Model loaded: Bagging")
|
| 18 |
+
|
| 19 |
+
# Input form
|
| 20 |
+
col1, col2 = st.columns(2)
|
| 21 |
+
with col1:
|
| 22 |
+
age = st.number_input("Age", 18, 100, 30)
|
| 23 |
+
income = st.number_input("Monthly Income", 0, 200000, 30000)
|
| 24 |
+
with col2:
|
| 25 |
+
trips = st.number_input("Number of Trips", 0, 20, 2)
|
| 26 |
+
passport = st.selectbox("Passport", [0, 1])
|
| 27 |
+
|
| 28 |
+
if st.button("Predict"):
|
| 29 |
+
st.info("Demo prediction interface")
|
| 30 |
+
st.write("Model: Bagging")
|
| 31 |
+
st.write("ROC-AUC: 0.9584")
|