File size: 1,630 Bytes
de2b822
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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)
    """)