Spaces:
Sleeping
Sleeping
Update pages/Life cycle of ML.py
Browse files- pages/Life cycle of ML.py +62 -159
pages/Life cycle of ML.py
CHANGED
|
@@ -1,164 +1,67 @@
|
|
| 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 |
-
border-radius: 8px;
|
| 50 |
-
padding: 10px 20px;
|
| 51 |
-
font-size: 1rem;
|
| 52 |
-
cursor: pointer;
|
| 53 |
-
margin-top: 20px;
|
| 54 |
-
transition: background-color 0.3s ease;
|
| 55 |
-
}
|
| 56 |
-
.back-button:hover {
|
| 57 |
-
background-color: #d9534f;
|
| 58 |
-
}
|
| 59 |
-
</style>
|
| 60 |
-
""",
|
| 61 |
-
unsafe_allow_html=True,
|
| 62 |
-
)
|
| 63 |
|
| 64 |
-
|
| 65 |
-
def home_page():
|
| 66 |
-
st.markdown("<div class='title'>Machine Learning Lifecycle</div>", unsafe_allow_html=True)
|
| 67 |
-
st.markdown("<div class='subtitle'>Explore the stages of an ML project!</div>", unsafe_allow_html=True)
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
<div class="button-container">
|
| 74 |
-
<button class="stage-button" onclick="location.href='?page=problem_definition'">1. Problem Definition</button>
|
| 75 |
-
<button class="stage-button" onclick="location.href='?page=data_collection'">2. Data Collection</button>
|
| 76 |
-
<button class="stage-button" onclick="location.href='?page=data_preparation'">3. Data Preparation</button>
|
| 77 |
-
</div>
|
| 78 |
-
<div class="button-container">
|
| 79 |
-
<button class="stage-button" onclick="location.href='?page=modeling'">4. Modeling</button>
|
| 80 |
-
<button class="stage-button" onclick="location.href='?page=evaluation'">5. Evaluation</button>
|
| 81 |
-
<button class="stage-button" onclick="location.href='?page=deployment'">6. Deployment</button>
|
| 82 |
-
</div>
|
| 83 |
-
""",
|
| 84 |
-
unsafe_allow_html=True,
|
| 85 |
-
)
|
| 86 |
-
|
| 87 |
-
def problem_definition_page():
|
| 88 |
-
st.markdown("<div class='title'>🎯 Problem Definition</div>", unsafe_allow_html=True)
|
| 89 |
-
st.write("Define the problem your machine learning model aims to solve.")
|
| 90 |
-
st.image("https://via.placeholder.com/600x300?text=Define+Problem", caption="Example: Problem Definition")
|
| 91 |
-
st.markdown(
|
| 92 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 93 |
-
unsafe_allow_html=True,
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
def data_collection_page():
|
| 97 |
-
st.markdown("<div class='title'>📊 Data Collection</div>", unsafe_allow_html=True)
|
| 98 |
-
st.write("Gather data relevant to the problem and verify data sources.")
|
| 99 |
-
st.image("https://via.placeholder.com/600x300?text=Data+Collection", caption="Data Sources Overview")
|
| 100 |
-
st.markdown(
|
| 101 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 102 |
-
unsafe_allow_html=True,
|
| 103 |
-
)
|
| 104 |
-
|
| 105 |
-
def data_preparation_page():
|
| 106 |
-
st.markdown("<div class='title'>🔄 Data Preparation</div>", unsafe_allow_html=True)
|
| 107 |
-
st.write("Preprocess, clean, and split the data into train, validation, and test sets.")
|
| 108 |
-
st.image("https://via.placeholder.com/600x300?text=Data+Preparation", caption="Data Preparation Overview")
|
| 109 |
-
st.markdown(
|
| 110 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 111 |
-
unsafe_allow_html=True,
|
| 112 |
-
)
|
| 113 |
-
|
| 114 |
-
def modeling_page():
|
| 115 |
-
st.markdown("<div class='title'>🤖 Modeling</div>", unsafe_allow_html=True)
|
| 116 |
-
st.write("Train machine learning models and tune hyperparameters.")
|
| 117 |
-
st.image("https://via.placeholder.com/600x300?text=Modeling", caption="Model Training Visualization")
|
| 118 |
-
st.markdown(
|
| 119 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 120 |
-
unsafe_allow_html=True,
|
| 121 |
-
)
|
| 122 |
-
|
| 123 |
-
def evaluation_page():
|
| 124 |
-
st.markdown("<div class='title'>✅ Evaluation</div>", unsafe_allow_html=True)
|
| 125 |
-
st.write("Evaluate model performance using standard metrics.")
|
| 126 |
-
st.image("https://via.placeholder.com/600x300?text=Evaluation", caption="Evaluation Metrics Overview")
|
| 127 |
-
st.markdown(
|
| 128 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 129 |
-
unsafe_allow_html=True,
|
| 130 |
-
)
|
| 131 |
-
|
| 132 |
-
def deployment_page():
|
| 133 |
-
st.markdown("<div class='title'>🚀 Deployment</div>", unsafe_allow_html=True)
|
| 134 |
-
st.write("Deploy your model for real-world use.")
|
| 135 |
-
st.image("https://via.placeholder.com/600x300?text=Deployment+Pipeline", caption="Deployment Pipeline")
|
| 136 |
-
st.markdown(
|
| 137 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 138 |
-
unsafe_allow_html=True,
|
| 139 |
-
)
|
| 140 |
-
|
| 141 |
-
def main():
|
| 142 |
-
add_custom_css()
|
| 143 |
-
query_params = st.get_query_params()
|
| 144 |
-
page = query_params.get("page", ["home"])[0]
|
| 145 |
-
|
| 146 |
-
if page == "home":
|
| 147 |
-
home_page()
|
| 148 |
-
elif page == "problem_definition":
|
| 149 |
-
problem_definition_page()
|
| 150 |
-
elif page == "data_collection":
|
| 151 |
-
data_collection_page()
|
| 152 |
-
elif page == "data_preparation":
|
| 153 |
-
data_preparation_page()
|
| 154 |
-
elif page == "modeling":
|
| 155 |
-
modeling_page()
|
| 156 |
-
elif page == "evaluation":
|
| 157 |
-
evaluation_page()
|
| 158 |
-
elif page == "deployment":
|
| 159 |
-
deployment_page()
|
| 160 |
-
else:
|
| 161 |
-
st.error("Page not found!")
|
| 162 |
-
|
| 163 |
-
if __name__ == "__main__":
|
| 164 |
-
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
|
| 5 |
+
# Apply custom CSS styling
|
| 6 |
+
st.markdown("""
|
| 7 |
+
<style>
|
| 8 |
+
/* Custom styling for background, headers, and text */
|
| 9 |
+
body {
|
| 10 |
+
background-color: #eef2f7;
|
| 11 |
+
}
|
| 12 |
+
h1 {
|
| 13 |
+
color: #00FFFF;
|
| 14 |
+
font-family: 'Roboto', sans-serif;
|
| 15 |
+
font-weight: 700;
|
| 16 |
+
text-align: center;
|
| 17 |
+
margin-bottom: 25px;
|
| 18 |
+
}
|
| 19 |
+
h2, h3 {
|
| 20 |
+
font-family: 'Roboto', sans-serif;
|
| 21 |
+
font-weight: 600;
|
| 22 |
+
}
|
| 23 |
+
h2 {
|
| 24 |
+
color: #FFFACD;
|
| 25 |
+
}
|
| 26 |
+
h3 {
|
| 27 |
+
color: #ba95b0;
|
| 28 |
+
}
|
| 29 |
+
p {
|
| 30 |
+
font-family: 'Georgia', serif;
|
| 31 |
+
line-height: 1.8;
|
| 32 |
+
color: #495057;
|
| 33 |
+
}
|
| 34 |
+
.icon-bullet {
|
| 35 |
+
list-style-type: none;
|
| 36 |
+
padding-left: 20px;
|
| 37 |
+
}
|
| 38 |
+
.icon-bullet li {
|
| 39 |
+
font-family: 'Georgia', serif;
|
| 40 |
+
font-size: 1.1em;
|
| 41 |
+
margin-bottom: 10px;
|
| 42 |
+
color: #495057;
|
| 43 |
+
}
|
| 44 |
+
.icon-bullet li::before {
|
| 45 |
+
content: "✔️";
|
| 46 |
+
padding-right: 10px;
|
| 47 |
+
color: #00FFFF;
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
st.title("**Lifecycle of Machine Learning**")
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
+
steps = [
|
| 55 |
+
"Problem Statement",
|
| 56 |
+
"Data Collection",
|
| 57 |
+
"Simple EDA",
|
| 58 |
+
"Data pre-processing",
|
| 59 |
+
"EDA",
|
| 60 |
+
"Feature Engineering",
|
| 61 |
+
"Training Model",
|
| 62 |
+
"Testing",
|
| 63 |
+
"Deployment",
|
| 64 |
+
"Monitoring",]
|
| 65 |
|
| 66 |
+
st.sidebar.title("Navigation")
|
| 67 |
+
selected_step = st.sidebar.radio("Steps in ML Lifecycle", steps)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|