import joblib import pandas as pd import streamlit as st model = joblib.load('model_tree.joblib') def main(): st.title("Network Ads") with st.form("questionaire"): age = st.slider('Age',min_value=10,max_value=100) salary = st.slider('Estimated Salary',min_value=10000,max_value=100000) clicked = st.form_submit_button("Predict income") if clicked: result=model.predict(pd.DataFrame({"age": [age],'Estimated Salary':[salary]})) # Show prediction result ='buy' if result[0]==1 else 'not buy' st.success("You will " +result+" this product") # Run main() if __name__=="__main__": main()