File size: 551 Bytes
5398047 5a4c63d 5398047 5a4c63d 7f69dd9 5398047 5a4c63d 5398047 5a4c63d 5398047 5a4c63d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import streamlit as st
import joblib
import numpy as np
# Load model
model = joblib.load("demo/model.pkl")
# App UI
st.title("🧠 AI Prediction App")
st.write("Enter age and salary to predict whether someone will buy the product.")
# Inputs
age = st.slider("Age", 18, 65, 30)
salary = st.number_input("Monthly Salary", 10000, 200000, 30000)
if st.button("Predict"):
input_data = np.array([[age, salary]])
prediction = model.predict(input_data)
result = "✅ Will Buy" if prediction[0] == 1 else "❌ Won't Buy"
st.success(result)
|