import streamlit as st def run(): st.title("6. Deployment & Testing") st.header("Introduction") st.write(""" Model Deployment is the process of integrating a machine learning model into a production environment where it can make predictions on new data. """) st.header("Objectives") st.write(""" - Integrate the model into production. - Monitor model performance. - Update the model as needed. """) st.write("## Overview") st.write("Deploying the model and testing its real-world performance.") st.write("## Key Concepts & Explanations") st.markdown(""" - **Deployment**: Making the model available for use (e.g., via an API). - **Testing**: Ensuring the model works in production environments. - **Model Monitoring**: Continuously tracking model performance in real-time. """) st.write("## Quiz: Conceptual Questions") q1 = st.radio("Which of the following is part of deployment?", ["Model Training", "Model Versioning", "Model Testing"]) if q1 == "Model Versioning": st.success("✅ Correct!") else: st.error("❌ Incorrect.") st.write("## Code-Based Quiz") code_input = st.text_area("Write code to save a model using joblib", value="import joblib\njoblib.dump(model, 'model.pkl')") if "joblib.dump" in code_input: st.success("✅ Correct!") else: st.error("❌ Try again.") st.write("## Learning Resources") st.markdown(""" - 📘 [Machine Learning Model Deployment](https://towardsdatascience.com/deploying-machine-learning-models-using-flask-285dbddedbfa) """)