Spaces:
Sleeping
Sleeping
Update pages/3_Life cycle of ML.py
Browse files- pages/3_Life cycle of ML.py +49 -83
pages/3_Life cycle of ML.py
CHANGED
|
@@ -1,84 +1,50 @@
|
|
| 1 |
import streamlit as st
|
| 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 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
</div>
|
| 52 |
-
</div>
|
| 53 |
-
<div style="position: absolute; top: 30%; left: 15%; transform: translate(-50%, -50%);">
|
| 54 |
-
<div style="background-color: #33ccff; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
|
| 55 |
-
6. Feature Engineering
|
| 56 |
-
</div>
|
| 57 |
-
</div>
|
| 58 |
-
<div style="position: absolute; top: 10%; left: 50%; transform: translate(-50%, -50%);">
|
| 59 |
-
<div style="background-color: #ff33a1; color: white; padding: 8px 15px; border-radius: 5px; text-align: center;">
|
| 60 |
-
7. Training the Model
|
| 61 |
-
</div>
|
| 62 |
-
</div>
|
| 63 |
-
</div>
|
| 64 |
-
</div>
|
| 65 |
-
"""
|
| 66 |
-
|
| 67 |
-
st.markdown(html_code, unsafe_allow_html=True)
|
| 68 |
-
|
| 69 |
-
# Descriptions for each step
|
| 70 |
-
descriptions = {
|
| 71 |
-
"1. Problem Statement": "**Define the aim or goal of your ML model.**",
|
| 72 |
-
"2. Data Collection": "**Gather data from various sources like APIs, web scraping, etc.**",
|
| 73 |
-
"3. Simple EDA": "**Explore data for missing values and outliers.**",
|
| 74 |
-
"4. Data Pre-Processing": "**Clean and transform the data.**",
|
| 75 |
-
"5. EDA": "**Gain deeper insights and visualize the data.**",
|
| 76 |
-
"6. Feature Engineering": "**Create new features for better model performance.**",
|
| 77 |
-
"7. Training the Model": "**Train your model using the prepared dataset.**"
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
step = st.selectbox("Select a step in the ML lifecycle to learn more:", list(descriptions.keys()))
|
| 81 |
-
st.write(descriptions[step])
|
| 82 |
-
|
| 83 |
-
if st.button("Learn More About Data Collection"):
|
| 84 |
-
navigate_to("data_collection")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from PIL import Image
|
| 3 |
+
|
| 4 |
+
def main():
|
| 5 |
+
# Set up the app title and layout
|
| 6 |
+
st.set_page_config(page_title="ML Lifecycle", layout="wide")
|
| 7 |
+
|
| 8 |
+
# Header section with title and subtitle
|
| 9 |
+
st.title("π Machine Learning Lifecycle: 10 Steps")
|
| 10 |
+
st.markdown("### A visually engaging journey through the ML lifecycle")
|
| 11 |
+
|
| 12 |
+
# Step descriptions and icons
|
| 13 |
+
steps = [
|
| 14 |
+
{"title": "1. Problem Definition", "description": "Define the problem, goals, and success criteria.", "icon": "π"},
|
| 15 |
+
{"title": "2. Data Collection", "description": "Gather data from various sources.", "icon": "π"},
|
| 16 |
+
{"title": "3. Data Cleaning", "description": "Handle missing values, remove duplicates, and fix errors.", "icon": "π§Ή"},
|
| 17 |
+
{"title": "4. Exploratory Data Analysis (EDA)", "description": "Understand data patterns and relationships.", "icon": "π"},
|
| 18 |
+
{"title": "5. Feature Engineering", "description": "Create, transform, or select important features.", "icon": "π οΈ"},
|
| 19 |
+
{"title": "6. Model Selection", "description": "Choose a suitable algorithm for the task.", "icon": "π€"},
|
| 20 |
+
{"title": "7. Model Training", "description": "Train the model using the training dataset.", "icon": "π―"},
|
| 21 |
+
{"title": "8. Model Evaluation", "description": "Assess the model's performance using metrics.", "icon": "π"},
|
| 22 |
+
{"title": "9. Deployment", "description": "Deploy the model for real-world use.", "icon": "π"},
|
| 23 |
+
{"title": "10. Monitoring & Maintenance", "description": "Monitor the model and update as needed.", "icon": "π‘"}
|
| 24 |
+
]
|
| 25 |
+
|
| 26 |
+
# Sidebar with navigation
|
| 27 |
+
st.sidebar.title("Navigate the Lifecycle")
|
| 28 |
+
selected_step = st.sidebar.radio("Steps", [step['title'] for step in steps])
|
| 29 |
+
|
| 30 |
+
# Display the selected step's details
|
| 31 |
+
for step in steps:
|
| 32 |
+
if step['title'] == selected_step:
|
| 33 |
+
st.subheader(f"{step['icon']} {step['title']}")
|
| 34 |
+
st.markdown(step['description'])
|
| 35 |
+
|
| 36 |
+
# Full timeline view
|
| 37 |
+
st.markdown("### Full Timeline")
|
| 38 |
+
cols = st.columns(10)
|
| 39 |
+
|
| 40 |
+
for idx, step in enumerate(steps):
|
| 41 |
+
with cols[idx]:
|
| 42 |
+
st.markdown(f"{step['icon']} **{step['title']}**")
|
| 43 |
+
|
| 44 |
+
# Footer section with images or a final message
|
| 45 |
+
st.markdown("---")
|
| 46 |
+
st.markdown("**Tip:** The ML lifecycle is iterative; revisit steps as needed!")
|
| 47 |
+
st.image("https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Machine_learning_lifecycle_diagram.jpg/1200px-Machine_learning_lifecycle_diagram.jpg", caption="Machine Learning Lifecycle", use_column_width=True)
|
| 48 |
+
|
| 49 |
+
if __name__ == "__main__":
|
| 50 |
+
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|