Spaces:
Sleeping
Sleeping
Update pages/3_Life cycle of ML.py
Browse files- pages/3_Life cycle of ML.py +63 -61
pages/3_Life cycle of ML.py
CHANGED
|
@@ -4,79 +4,81 @@ import streamlit as st
|
|
| 4 |
if "page" not in st.session_state:
|
| 5 |
st.session_state.page = "main"
|
| 6 |
|
| 7 |
-
#
|
| 8 |
def navigate_to(page_name):
|
| 9 |
st.session_state.page = page_name
|
| 10 |
|
| 11 |
-
#
|
| 12 |
if st.session_state.page == "main":
|
|
|
|
| 13 |
st.markdown(
|
| 14 |
"""
|
| 15 |
-
<div style="
|
| 16 |
-
<h2 style="color: #4a90e2; font-family: Arial, sans-serif;">
|
| 17 |
</div>
|
| 18 |
""",
|
| 19 |
unsafe_allow_html=True,
|
| 20 |
)
|
| 21 |
|
| 22 |
-
# Life
|
| 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 |
-
border-radius: 8px;
|
| 50 |
-
padding: 20px;
|
| 51 |
-
text-align: center;
|
| 52 |
-
cursor: pointer;
|
| 53 |
-
transition: all 0.3s ease;
|
| 54 |
-
}
|
| 55 |
-
.grid-item:hover {
|
| 56 |
-
background-color: #e8e8f0;
|
| 57 |
-
}
|
| 58 |
-
</style>
|
| 59 |
-
<div class="grid-container">
|
| 60 |
-
""" +
|
| 61 |
-
"".join([f'<div class="grid-item" onclick="window.location.href='#{step[0].replace(" ", "-")}';">{step[0]}</div>' for step in steps]) +
|
| 62 |
-
"</div>"
|
| 63 |
-
""", unsafe_allow_html=True )
|
| 64 |
|
| 65 |
-
#
|
| 66 |
-
|
| 67 |
-
st.write(f"
|
| 68 |
-
for step in steps:
|
| 69 |
-
if step[0] == selected_step:
|
| 70 |
-
st.write(step[1])
|
| 71 |
-
break
|
| 72 |
|
| 73 |
-
#
|
| 74 |
-
if
|
| 75 |
navigate_to("data_collection")
|
| 76 |
-
|
| 77 |
-
elif st.session_state.page == "data_collection":
|
| 78 |
-
st.title("Data Collection")
|
| 79 |
-
st.write("Here you can provide detailed content about data collection methods.")
|
| 80 |
-
if st.button("Back to Main Page"):
|
| 81 |
-
navigate_to("main")
|
| 82 |
-
|
|
|
|
| 4 |
if "page" not in st.session_state:
|
| 5 |
st.session_state.page = "main"
|
| 6 |
|
| 7 |
+
# Navigation function
|
| 8 |
def navigate_to(page_name):
|
| 9 |
st.session_state.page = page_name
|
| 10 |
|
| 11 |
+
# Main page
|
| 12 |
if st.session_state.page == "main":
|
| 13 |
+
# Page header
|
| 14 |
st.markdown(
|
| 15 |
"""
|
| 16 |
+
<div style="background-color: #f0f0f5; padding: 10px; border-radius: 5px; text-align: center;">
|
| 17 |
+
<h2 style="color: #4a90e2; font-family: Arial, sans-serif;">ML Project Life Cycle</h2>
|
| 18 |
</div>
|
| 19 |
""",
|
| 20 |
unsafe_allow_html=True,
|
| 21 |
)
|
| 22 |
|
| 23 |
+
# Circular Life Cycle Visualization
|
| 24 |
+
html_code = """
|
| 25 |
+
<div style="display: flex; justify-content: center; align-items: center; margin: 20px;">
|
| 26 |
+
<div style="position: relative; width: 350px; height: 350px; border-radius: 50%;">
|
| 27 |
+
<div style="position: absolute; width: 100%; height: 100%;">
|
| 28 |
+
<div style="position: absolute; transform: rotate(0deg) translateX(130px);">
|
| 29 |
+
<div style="background: #ff5733; color: white; padding: 10px; border-radius: 5px; text-align: center;">Problem Statement</div>
|
| 30 |
+
</div>
|
| 31 |
+
<div style="position: absolute; transform: rotate(36deg) translateX(130px);">
|
| 32 |
+
<div style="background: #33b5ff; color: white; padding: 10px; border-radius: 5px; text-align: center;">Data Collection</div>
|
| 33 |
+
</div>
|
| 34 |
+
<div style="position: absolute; transform: rotate(72deg) translateX(130px);">
|
| 35 |
+
<div style="background: #33ff57; color: white; padding: 10px; border-radius: 5px; text-align: center;">Simple EDA</div>
|
| 36 |
+
</div>
|
| 37 |
+
<div style="position: absolute; transform: rotate(108deg) translateX(130px);">
|
| 38 |
+
<div style="background: #ff33cc; color: white; padding: 10px; border-radius: 5px; text-align: center;">Data Pre-Processing</div>
|
| 39 |
+
</div>
|
| 40 |
+
<div style="position: absolute; transform: rotate(144deg) translateX(130px);">
|
| 41 |
+
<div style="background: #ffcc33; color: white; padding: 10px; border-radius: 5px; text-align: center;">EDA</div>
|
| 42 |
+
</div>
|
| 43 |
+
<div style="position: absolute; transform: rotate(180deg) translateX(130px);">
|
| 44 |
+
<div style="background: #33ccff; color: white; padding: 10px; border-radius: 5px; text-align: center;">Feature Engineering</div>
|
| 45 |
+
</div>
|
| 46 |
+
<div style="position: absolute; transform: rotate(216deg) translateX(130px);">
|
| 47 |
+
<div style="background: #ff33a1; color: white; padding: 10px; border-radius: 5px; text-align: center;">Training</div>
|
| 48 |
+
</div>
|
| 49 |
+
<div style="position: absolute; transform: rotate(252deg) translateX(130px);">
|
| 50 |
+
<div style="background: #66ff33; color: white; padding: 10px; border-radius: 5px; text-align: center;">Testing</div>
|
| 51 |
+
</div>
|
| 52 |
+
<div style="position: absolute; transform: rotate(288deg) translateX(130px);">
|
| 53 |
+
<div style="background: #9933ff; color: white; padding: 10px; border-radius: 5px; text-align: center;">Deployment</div>
|
| 54 |
+
</div>
|
| 55 |
+
<div style="position: absolute; transform: rotate(324deg) translateX(130px);">
|
| 56 |
+
<div style="background: #f7a500; color: white; padding: 10px; border-radius: 5px; text-align: center;">Monitoring</div>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
"""
|
| 62 |
+
st.markdown(html_code, unsafe_allow_html=True)
|
| 63 |
|
| 64 |
+
# Descriptions
|
| 65 |
+
descriptions = {
|
| 66 |
+
"Problem Statement": "Define the goal of the ML model.",
|
| 67 |
+
"Data Collection": "Gather data from various sources.",
|
| 68 |
+
"Simple EDA": "Identify missing values and outliers.",
|
| 69 |
+
"Data Pre-Processing": "Clean and transform the data.",
|
| 70 |
+
"EDA": "Gain insights through visualizations.",
|
| 71 |
+
"Feature Engineering": "Extract and create useful features.",
|
| 72 |
+
"Training": "Train the model with prepared data.",
|
| 73 |
+
"Testing": "Evaluate the model's performance.",
|
| 74 |
+
"Deployment": "Deploy the model for real-world use.",
|
| 75 |
+
"Monitoring": "Track and update model performance."
|
| 76 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
# Select step
|
| 79 |
+
step = st.selectbox("Select a step to learn more:", descriptions.keys())
|
| 80 |
+
st.write(f"**{step}:** {descriptions[step]}")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
+
# Additional navigation for Data Collection
|
| 83 |
+
if step == "Data Collection" and st.button("Learn More About Data Collection"):
|
| 84 |
navigate_to("data_collection")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|