Upload 2 files
Browse files- app.py +20 -0
- requirements.txt +4 -0
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import joblib
|
| 4 |
+
|
| 5 |
+
st.title("Wellness Tourism Package Predictor")
|
| 6 |
+
|
| 7 |
+
model = joblib.load("model.joblib")
|
| 8 |
+
|
| 9 |
+
age = st.number_input("Age", 18, 100)
|
| 10 |
+
income = st.number_input("Monthly Income", 0)
|
| 11 |
+
trips = st.number_input("Number of Trips", 0)
|
| 12 |
+
|
| 13 |
+
if st.button("Predict"):
|
| 14 |
+
df = pd.DataFrame([{
|
| 15 |
+
"Age": age,
|
| 16 |
+
"MonthlyIncome": income,
|
| 17 |
+
"NumberOfTrips": trips
|
| 18 |
+
}])
|
| 19 |
+
prob = model.predict_proba(df)[0][1]
|
| 20 |
+
st.success(f"Purchase Probability: {prob:.2f}")
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
pandas
|
| 3 |
+
scikit-learn
|
| 4 |
+
joblib
|