| import streamlit as st | |
| import pandas as pd | |
| import joblib | |
| # Load model & features | |
| model = joblib.load("src/final_model.pkl") | |
| features = joblib.load("src/model_features.pkl") | |
| st.title("🎒 Backpack Price Predictor") | |
| st.write("Enter backpack features to predict price") | |
| input_data = {} | |
| for feature in features: | |
| input_data[feature] = st.number_input(f"{feature}", value=0.0) | |
| input_df = pd.DataFrame([input_data]) | |
| if st.button("Predict"): | |
| prediction = model.predict(input_df)[0] | |
| st.success(f"Predicted Price: {prediction:.2f}") | |