Spaces:
Sleeping
Sleeping
Update pages/Life cycle of ML.py
Browse files- pages/Life cycle of ML.py +0 -161
pages/Life cycle of ML.py
CHANGED
|
@@ -1,163 +1,2 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
# Custom CSS styling
|
| 4 |
-
def add_custom_css():
|
| 5 |
-
st.markdown(
|
| 6 |
-
"""
|
| 7 |
-
<style>
|
| 8 |
-
body {
|
| 9 |
-
font-family: 'Arial', sans-serif;
|
| 10 |
-
background-color: #f7f9fc;
|
| 11 |
-
}
|
| 12 |
-
.title {
|
| 13 |
-
text-align: center;
|
| 14 |
-
font-size: 2.5rem;
|
| 15 |
-
color: #1f77b4;
|
| 16 |
-
font-weight: bold;
|
| 17 |
-
margin-bottom: 20px;
|
| 18 |
-
}
|
| 19 |
-
.subtitle {
|
| 20 |
-
text-align: center;
|
| 21 |
-
font-size: 1.5rem;
|
| 22 |
-
color: #555555;
|
| 23 |
-
margin-top: -15px;
|
| 24 |
-
margin-bottom: 30px;
|
| 25 |
-
}
|
| 26 |
-
.button-container {
|
| 27 |
-
display: flex;
|
| 28 |
-
justify-content: space-evenly;
|
| 29 |
-
margin: 20px 0;
|
| 30 |
-
}
|
| 31 |
-
.stage-button {
|
| 32 |
-
background-color: #1f77b4;
|
| 33 |
-
color: white;
|
| 34 |
-
border: none;
|
| 35 |
-
border-radius: 8px;
|
| 36 |
-
padding: 10px 20px;
|
| 37 |
-
font-size: 1.2rem;
|
| 38 |
-
cursor: pointer;
|
| 39 |
-
text-transform: uppercase;
|
| 40 |
-
transition: background-color 0.3s ease;
|
| 41 |
-
}
|
| 42 |
-
.stage-button:hover {
|
| 43 |
-
background-color: #145a86;
|
| 44 |
-
}
|
| 45 |
-
.back-button {
|
| 46 |
-
background-color: #ff6347;
|
| 47 |
-
color: white;
|
| 48 |
-
border: none;
|
| 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 |
-
def home_page():
|
| 65 |
-
st.markdown("<div class='title'>Machine Learning Lifecycle</div>", unsafe_allow_html=True)
|
| 66 |
-
|
| 67 |
-
st.image("https://via.placeholder.com/800x400?text=ML+Lifecycle", caption="Visual Representation of ML Lifecycle")
|
| 68 |
-
|
| 69 |
-
st.markdown(
|
| 70 |
-
"""
|
| 71 |
-
<div class="button-container">
|
| 72 |
-
<button class="stage-button" onclick="location.href='?page=problem_definition'">1. Problem Definition</button>
|
| 73 |
-
<button class="stage-button" onclick="location.href='?page=data_collection'">2. Data Collection</button>
|
| 74 |
-
<button class="stage-button" onclick="location.href='?page=data_preparation'">3. Data Preparation</button>
|
| 75 |
-
</div>
|
| 76 |
-
<div class="button-container">
|
| 77 |
-
<button class="stage-button" onclick="location.href='?page=modeling'">4. Modeling</button>
|
| 78 |
-
<button class="stage-button" onclick="location.href='?page=evaluation'">5. Evaluation</button>
|
| 79 |
-
<button class="stage-button" onclick="location.href='?page=deployment'">6. Deployment</button>
|
| 80 |
-
</div>
|
| 81 |
-
""",
|
| 82 |
-
unsafe_allow_html=True,
|
| 83 |
-
)
|
| 84 |
-
|
| 85 |
-
def problem_definition_page():
|
| 86 |
-
st.markdown("<div class='title'>🎯 Problem Definition</div>", unsafe_allow_html=True)
|
| 87 |
-
st.write("Define the problem your machine learning model aims to solve.")
|
| 88 |
-
st.image("https://via.placeholder.com/600x300?text=Define+Problem", caption="Example: Problem Definition")
|
| 89 |
-
st.markdown(
|
| 90 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 91 |
-
unsafe_allow_html=True,
|
| 92 |
-
)
|
| 93 |
-
|
| 94 |
-
def data_collection_page():
|
| 95 |
-
st.markdown("<div class='title'>📊 Data Collection</div>", unsafe_allow_html=True)
|
| 96 |
-
st.write("Gather data relevant to the problem and verify data sources.")
|
| 97 |
-
st.image("https://via.placeholder.com/600x300?text=Data+Collection", caption="Data Sources Overview")
|
| 98 |
-
st.markdown(
|
| 99 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 100 |
-
unsafe_allow_html=True,
|
| 101 |
-
)
|
| 102 |
-
|
| 103 |
-
def data_preparation_page():
|
| 104 |
-
st.markdown("<div class='title'>🔄 Data Preparation</div>", unsafe_allow_html=True)
|
| 105 |
-
st.write("Preprocess, clean, and split the data into train, validation, and test sets.")
|
| 106 |
-
st.image("https://via.placeholder.com/600x300?text=Data+Preparation", caption="Data Preparation Overview")
|
| 107 |
-
st.markdown(
|
| 108 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 109 |
-
unsafe_allow_html=True,
|
| 110 |
-
)
|
| 111 |
-
|
| 112 |
-
def modeling_page():
|
| 113 |
-
st.markdown("<div class='title'>🤖 Modeling</div>", unsafe_allow_html=True)
|
| 114 |
-
st.write("Train machine learning models and tune hyperparameters.")
|
| 115 |
-
st.image("https://via.placeholder.com/600x300?text=Modeling", caption="Model Training Visualization")
|
| 116 |
-
st.markdown(
|
| 117 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 118 |
-
unsafe_allow_html=True,
|
| 119 |
-
)
|
| 120 |
-
|
| 121 |
-
def evaluation_page():
|
| 122 |
-
st.markdown("<div class='title'>✅ Evaluation</div>", unsafe_allow_html=True)
|
| 123 |
-
st.write("Evaluate model performance using standard metrics.")
|
| 124 |
-
st.image("https://via.placeholder.com/600x300?text=Evaluation", caption="Evaluation Metrics Overview")
|
| 125 |
-
st.markdown(
|
| 126 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 127 |
-
unsafe_allow_html=True,
|
| 128 |
-
)
|
| 129 |
-
|
| 130 |
-
def deployment_page():
|
| 131 |
-
st.markdown("<div class='title'>🚀 Deployment</div>", unsafe_allow_html=True)
|
| 132 |
-
st.write("Deploy your model for real-world use.")
|
| 133 |
-
st.image("https://via.placeholder.com/600x300?text=Deployment+Pipeline", caption="Deployment Pipeline")
|
| 134 |
-
st.markdown(
|
| 135 |
-
"<button class='back-button' onclick=\"location.href='?page=home'\">Back to Home</button>",
|
| 136 |
-
unsafe_allow_html=True,
|
| 137 |
-
)
|
| 138 |
-
|
| 139 |
-
# Main routing logic
|
| 140 |
-
def main():
|
| 141 |
-
add_custom_css()
|
| 142 |
-
query_params = st.query_params()
|
| 143 |
-
page = query_params.get("page", ["home"])[0]
|
| 144 |
-
|
| 145 |
-
if page == "home":
|
| 146 |
-
home_page()
|
| 147 |
-
elif page == "problem_definition":
|
| 148 |
-
problem_definition_page()
|
| 149 |
-
elif page == "data_collection":
|
| 150 |
-
data_collection_page()
|
| 151 |
-
elif page == "data_preparation":
|
| 152 |
-
data_preparation_page()
|
| 153 |
-
elif page == "modeling":
|
| 154 |
-
modeling_page()
|
| 155 |
-
elif page == "evaluation":
|
| 156 |
-
evaluation_page()
|
| 157 |
-
elif page == "deployment":
|
| 158 |
-
deployment_page()
|
| 159 |
-
else:
|
| 160 |
-
st.error("Page not found!")
|
| 161 |
-
|
| 162 |
-
if __name__ == "__main__":
|
| 163 |
-
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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