Spaces:
Sleeping
Sleeping
Update pages/3_Life cycle of ML.py
Browse files- pages/3_Life cycle of ML.py +75 -54
pages/3_Life cycle of ML.py
CHANGED
|
@@ -1,49 +1,65 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from graphviz import Digraph
|
| 3 |
|
|
|
|
| 4 |
custom_css = """
|
| 5 |
<style>
|
| 6 |
html, body, [data-testid="stAppViewContainer"] {
|
| 7 |
-
background: linear-gradient(
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
}
|
| 11 |
h1 {
|
| 12 |
-
color: #
|
| 13 |
text-align: center;
|
| 14 |
-
font-size:
|
| 15 |
margin-top: 20px;
|
| 16 |
-
text-shadow: 1px 1px 3px rgba(
|
| 17 |
}
|
| 18 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
background-color: #4CAF50;
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
color: white;
|
| 22 |
-
padding: 12px 24px;
|
| 23 |
-
text-align: center;
|
| 24 |
font-size: 16px;
|
| 25 |
-
|
| 26 |
cursor: pointer;
|
| 27 |
-
transition:
|
| 28 |
}
|
| 29 |
-
.
|
| 30 |
background-color: #45a049;
|
| 31 |
-
transform: scale(1.
|
| 32 |
}
|
| 33 |
-
.
|
| 34 |
-
|
| 35 |
-
margin-top: 10px;
|
| 36 |
}
|
| 37 |
</style>
|
| 38 |
"""
|
| 39 |
|
|
|
|
| 40 |
st.markdown(custom_css, unsafe_allow_html=True)
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
st.
|
| 45 |
|
| 46 |
-
|
|
|
|
| 47 |
"Problem Statement",
|
| 48 |
"Data Collection",
|
| 49 |
"Simple EDA",
|
|
@@ -52,42 +68,47 @@ steps = [
|
|
| 52 |
"Feature Engineering",
|
| 53 |
"Model Training",
|
| 54 |
"Testing",
|
| 55 |
-
"Deployment
|
|
|
|
| 56 |
]
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
"
|
| 61 |
-
"
|
| 62 |
-
"
|
| 63 |
-
"
|
| 64 |
-
"
|
| 65 |
-
"
|
| 66 |
-
"
|
| 67 |
-
"
|
|
|
|
|
|
|
| 68 |
}
|
| 69 |
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
|
| 91 |
-
if selected_step:
|
| 92 |
-
st.markdown(f"<h2>{selected_step}</h2>", unsafe_allow_html=True)
|
| 93 |
-
st.markdown(f"<p style='font-size:1.1rem; text-align:center;'>{descriptions[selected_step]}</p>", unsafe_allow_html=True)
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
|
| 3 |
+
# Custom CSS for styling
|
| 4 |
custom_css = """
|
| 5 |
<style>
|
| 6 |
html, body, [data-testid="stAppViewContainer"] {
|
| 7 |
+
background: linear-gradient(
|
| 8 |
+
rgba(255, 255, 255, 0.9),
|
| 9 |
+
rgba(200, 200, 255, 0.8)
|
| 10 |
+
),
|
| 11 |
+
url('https://i.imgur.com/vIszbgs.jpeg') no-repeat center center fixed;
|
| 12 |
+
background-size: cover;
|
| 13 |
+
font-family: Arial, sans-serif;
|
| 14 |
+
color: #333333;
|
| 15 |
}
|
| 16 |
h1 {
|
| 17 |
+
color: #2c3e50;
|
| 18 |
text-align: center;
|
| 19 |
+
font-size: 3rem;
|
| 20 |
margin-top: 20px;
|
| 21 |
+
text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8);
|
| 22 |
}
|
| 23 |
+
.circle-container {
|
| 24 |
+
display: flex;
|
| 25 |
+
justify-content: center;
|
| 26 |
+
flex-wrap: wrap;
|
| 27 |
+
gap: 20px;
|
| 28 |
+
margin-top: 30px;
|
| 29 |
+
}
|
| 30 |
+
.circle-button {
|
| 31 |
+
width: 100px;
|
| 32 |
+
height: 100px;
|
| 33 |
+
border-radius: 50%;
|
| 34 |
background-color: #4CAF50;
|
| 35 |
+
display: flex;
|
| 36 |
+
justify-content: center;
|
| 37 |
+
align-items: center;
|
| 38 |
color: white;
|
|
|
|
|
|
|
| 39 |
font-size: 16px;
|
| 40 |
+
text-align: center;
|
| 41 |
cursor: pointer;
|
| 42 |
+
transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
|
| 43 |
}
|
| 44 |
+
.circle-button:hover {
|
| 45 |
background-color: #45a049;
|
| 46 |
+
transform: scale(1.1);
|
| 47 |
}
|
| 48 |
+
.selected {
|
| 49 |
+
background-color: #2c3e50 !important;
|
|
|
|
| 50 |
}
|
| 51 |
</style>
|
| 52 |
"""
|
| 53 |
|
| 54 |
+
# Apply CSS
|
| 55 |
st.markdown(custom_css, unsafe_allow_html=True)
|
| 56 |
|
| 57 |
+
# Title
|
| 58 |
+
st.markdown("<h1>ML Project Lifecycle</h1>", unsafe_allow_html=True)
|
| 59 |
+
st.write("Click on a lifecycle step below to learn more.")
|
| 60 |
|
| 61 |
+
# Lifecycle stages
|
| 62 |
+
stages = [
|
| 63 |
"Problem Statement",
|
| 64 |
"Data Collection",
|
| 65 |
"Simple EDA",
|
|
|
|
| 68 |
"Feature Engineering",
|
| 69 |
"Model Training",
|
| 70 |
"Testing",
|
| 71 |
+
"Deployment",
|
| 72 |
+
"Maintenance",
|
| 73 |
]
|
| 74 |
|
| 75 |
+
# Descriptions for each stage
|
| 76 |
+
stage_descriptions = {
|
| 77 |
+
"Problem Statement": "Define the objective and scope of the project.",
|
| 78 |
+
"Data Collection": "Gather data from various reliable sources.",
|
| 79 |
+
"Simple EDA": "Summarize and understand the quality of the data.",
|
| 80 |
+
"Data Pre-Processing": "Clean and prepare the data by removing noise.",
|
| 81 |
+
"EDA": "Visualize and analyze data to uncover patterns.",
|
| 82 |
+
"Feature Engineering": "Create, transform, and select features for modeling.",
|
| 83 |
+
"Model Training": "Train the ML model using prepared data.",
|
| 84 |
+
"Testing": "Evaluate the model's performance and accuracy.",
|
| 85 |
+
"Deployment": "Integrate the model into a production environment.",
|
| 86 |
+
"Maintenance": "Monitor and update the model to ensure performance.",
|
| 87 |
}
|
| 88 |
|
| 89 |
+
# State management for the selected stage
|
| 90 |
+
if "selected_stage" not in st.session_state:
|
| 91 |
+
st.session_state.selected_stage = None
|
| 92 |
|
| 93 |
+
# Display lifecycle steps as circular buttons
|
| 94 |
+
st.markdown('<div class="circle-container">', unsafe_allow_html=True)
|
| 95 |
+
for stage in stages:
|
| 96 |
+
is_selected = st.session_state.selected_stage == stage
|
| 97 |
+
btn_class = "circle-button selected" if is_selected else "circle-button"
|
| 98 |
+
if st.markdown(
|
| 99 |
+
f"""
|
| 100 |
+
<div class="{btn_class}" onclick="window.parent.streamlit.runOnClick({repr(stage)})">
|
| 101 |
+
{stage}
|
| 102 |
+
</div>
|
| 103 |
+
""",
|
| 104 |
+
unsafe_allow_html=True,
|
| 105 |
+
):
|
| 106 |
+
st.session_state.selected_stage = stage
|
| 107 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 108 |
|
| 109 |
+
# Display description of the selected stage
|
| 110 |
+
if st.session_state.selected_stage:
|
| 111 |
+
selected_stage = st.session_state.selected_stage
|
| 112 |
+
st.markdown(f"### {selected_stage}")
|
| 113 |
+
st.write(stage_descriptions[selected_stage])
|
| 114 |
|
|
|
|
|
|
|
|
|