Spaces:
Sleeping
Sleeping
Update pages/3Life Cycle of Machine Learning Project.py
Browse files
pages/3Life Cycle of Machine Learning Project.py
CHANGED
|
@@ -7,6 +7,14 @@ st.set_page_config(
|
|
| 7 |
layout="wide"
|
| 8 |
)
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Global CSS for consistent styling
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
|
@@ -22,137 +30,123 @@ st.markdown("""
|
|
| 22 |
margin-top: 20px;
|
| 23 |
margin-bottom: 10px;
|
| 24 |
}
|
| 25 |
-
.
|
| 26 |
display: flex;
|
| 27 |
-
flex-wrap: wrap;
|
| 28 |
justify-content: center;
|
| 29 |
-
|
| 30 |
-
margin-top:
|
| 31 |
}
|
| 32 |
-
.
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
font-size: 16px;
|
| 36 |
-
|
| 37 |
-
|
| 38 |
border-radius: 30px;
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
| 40 |
cursor: pointer;
|
| 41 |
-
|
|
|
|
|
|
|
| 42 |
}
|
| 43 |
-
.
|
| 44 |
-
background-color: #e6e6fa;
|
| 45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
</style>
|
| 47 |
""", unsafe_allow_html=True)
|
| 48 |
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
st.experimental_set_query_params(page=page_name)
|
| 52 |
-
|
| 53 |
-
# Get the current page from query parameters
|
| 54 |
-
query_params = st.experimental_get_query_params()
|
| 55 |
-
current_page = query_params.get("page", ["Home"])[0]
|
| 56 |
-
|
| 57 |
-
# Main content
|
| 58 |
-
if current_page == "Home":
|
| 59 |
# Home Page Content
|
| 60 |
st.markdown('<h1>Life Cycle of End-to-End ML Project</h1>', unsafe_allow_html=True)
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
</div>
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
#
|
| 76 |
-
st.
|
| 77 |
-
if st.button("Problem Statement"):
|
| 78 |
navigate_to("ProblemStatement")
|
| 79 |
-
if st.button("Data Collection"):
|
| 80 |
navigate_to("DataCollection")
|
| 81 |
-
if st.button("Simple EDA"):
|
| 82 |
navigate_to("SimpleEDA")
|
| 83 |
-
if st.button("Data Preprocessing"):
|
| 84 |
navigate_to("DataPreprocessing")
|
| 85 |
-
if st.button("EDA"):
|
| 86 |
navigate_to("EDA")
|
| 87 |
-
if st.button("Feature Engineering"):
|
| 88 |
navigate_to("FeatureEngineering")
|
| 89 |
-
if st.button("Model Training"):
|
| 90 |
navigate_to("ModelTraining")
|
| 91 |
-
if st.button("Model Testing"):
|
| 92 |
navigate_to("ModelTesting")
|
| 93 |
-
if st.button("Model Deployment"):
|
| 94 |
navigate_to("ModelDeployment")
|
| 95 |
-
if st.button("Monitoring"):
|
| 96 |
navigate_to("Monitoring")
|
| 97 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 98 |
|
| 99 |
-
#
|
| 100 |
-
elif
|
| 101 |
-
st.
|
| 102 |
-
st.write("Define the
|
| 103 |
if st.button("Go Back"):
|
| 104 |
navigate_to("Home")
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
st.
|
| 108 |
-
st.write("Collect and gather relevant data from various sources for analysis.")
|
| 109 |
if st.button("Go Back"):
|
| 110 |
navigate_to("Home")
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
st.
|
| 114 |
-
st.write("Perform basic exploratory data analysis to understand the dataset structure.")
|
| 115 |
if st.button("Go Back"):
|
| 116 |
navigate_to("Home")
|
|
|
|
| 117 |
|
| 118 |
-
elif current_page == "DataPreprocessing":
|
| 119 |
-
st.markdown("<h1>Data Preprocessing</h1>", unsafe_allow_html=True)
|
| 120 |
-
st.write("Clean and preprocess the collected data to make it suitable for modeling.")
|
| 121 |
-
if st.button("Go Back"):
|
| 122 |
-
navigate_to("Home")
|
| 123 |
-
|
| 124 |
-
elif current_page == "EDA":
|
| 125 |
-
st.markdown("<h1>EDA</h1>", unsafe_allow_html=True)
|
| 126 |
-
st.write("Perform advanced exploratory data analysis to identify patterns and insights.")
|
| 127 |
-
if st.button("Go Back"):
|
| 128 |
-
navigate_to("Home")
|
| 129 |
-
|
| 130 |
-
elif current_page == "FeatureEngineering":
|
| 131 |
-
st.markdown("<h1>Feature Engineering</h1>", unsafe_allow_html=True)
|
| 132 |
-
st.write("Create, select, or transform features to improve model performance.")
|
| 133 |
-
if st.button("Go Back"):
|
| 134 |
-
navigate_to("Home")
|
| 135 |
-
|
| 136 |
-
elif current_page == "ModelTraining":
|
| 137 |
-
st.markdown("<h1>Model Training</h1>", unsafe_allow_html=True)
|
| 138 |
-
st.write("Train machine learning models on the preprocessed data.")
|
| 139 |
-
if st.button("Go Back"):
|
| 140 |
-
navigate_to("Home")
|
| 141 |
-
|
| 142 |
-
elif current_page == "ModelTesting":
|
| 143 |
-
st.markdown("<h1>Model Testing</h1>", unsafe_allow_html=True)
|
| 144 |
-
st.write("Test the trained models using validation or test datasets.")
|
| 145 |
-
if st.button("Go Back"):
|
| 146 |
-
navigate_to("Home")
|
| 147 |
-
|
| 148 |
-
elif current_page == "ModelDeployment":
|
| 149 |
-
st.markdown("<h1>Model Deployment</h1>", unsafe_allow_html=True)
|
| 150 |
-
st.write("Deploy the model to production for real-world usage.")
|
| 151 |
-
if st.button("Go Back"):
|
| 152 |
-
navigate_to("Home")
|
| 153 |
-
|
| 154 |
-
elif current_page == "Monitoring":
|
| 155 |
-
st.markdown("<h1>Monitoring</h1>", unsafe_allow_html=True)
|
| 156 |
-
st.write("Monitor the model's performance in production and retrain if needed.")
|
| 157 |
-
if st.button("Go Back"):
|
| 158 |
-
navigate_to("Home")
|
|
|
|
| 7 |
layout="wide"
|
| 8 |
)
|
| 9 |
|
| 10 |
+
# Initialize session state for navigation
|
| 11 |
+
if "page" not in st.session_state:
|
| 12 |
+
st.session_state.page = "Home"
|
| 13 |
+
|
| 14 |
+
# Function to handle navigation
|
| 15 |
+
def navigate_to(page_name):
|
| 16 |
+
st.session_state.page = page_name
|
| 17 |
+
|
| 18 |
# Global CSS for consistent styling
|
| 19 |
st.markdown("""
|
| 20 |
<style>
|
|
|
|
| 30 |
margin-top: 20px;
|
| 31 |
margin-bottom: 10px;
|
| 32 |
}
|
| 33 |
+
.circle-container {
|
| 34 |
display: flex;
|
|
|
|
| 35 |
justify-content: center;
|
| 36 |
+
align-items: center;
|
| 37 |
+
margin-top: 50px;
|
| 38 |
}
|
| 39 |
+
.circle {
|
| 40 |
+
position: relative;
|
| 41 |
+
width: 1100px;
|
| 42 |
+
height: 1100px;
|
| 43 |
+
border-radius: 50%;
|
| 44 |
+
display: flex;
|
| 45 |
+
justify-content: center;
|
| 46 |
+
align-items: center;
|
| 47 |
+
}
|
| 48 |
+
.steps {
|
| 49 |
+
position: absolute;
|
| 50 |
+
width: 100%;
|
| 51 |
+
height: 100%;
|
| 52 |
+
display: flex;
|
| 53 |
+
justify-content: center;
|
| 54 |
+
align-items: center;
|
| 55 |
+
}
|
| 56 |
+
.step {
|
| 57 |
+
position: absolute;
|
| 58 |
+
width: 160px;
|
| 59 |
+
height: 60px;
|
| 60 |
font-size: 16px;
|
| 61 |
+
background-color: #f0f8ff;
|
| 62 |
+
color: black;
|
| 63 |
border-radius: 30px;
|
| 64 |
+
display: flex;
|
| 65 |
+
justify-content: center;
|
| 66 |
+
align-items: center;
|
| 67 |
+
text-align: center;
|
| 68 |
cursor: pointer;
|
| 69 |
+
transform-origin: 50% 50%;
|
| 70 |
+
transition: transform 0.3s ease, background-color 0.3s ease;
|
| 71 |
+
font-weight: bold;
|
| 72 |
}
|
| 73 |
+
.step:hover {
|
| 74 |
+
background-color: #e6e6fa;
|
| 75 |
}
|
| 76 |
+
#step1 { transform: rotate(0deg) translateX(320px) rotate(-0deg); }
|
| 77 |
+
#step2 { transform: rotate(36deg) translateX(320px) rotate(-36deg); }
|
| 78 |
+
#step3 { transform: rotate(72deg) translateX(320px) rotate(-72deg); }
|
| 79 |
+
#step4 { transform: rotate(108deg) translateX(320px) rotate(-108deg); }
|
| 80 |
+
#step5 { transform: rotate(144deg) translateX(320px) rotate(-144deg); }
|
| 81 |
+
#step6 { transform: rotate(180deg) translateX(320px) rotate(-180deg); }
|
| 82 |
+
#step7 { transform: rotate(216deg) translateX(320px) rotate(-216deg); }
|
| 83 |
+
#step8 { transform: rotate(252deg) translateX(320px) rotate(-252deg); }
|
| 84 |
+
#step9 { transform: rotate(288deg) translateX(320px) rotate(-288deg); }
|
| 85 |
+
#step10 { transform: rotate(324deg) translateX(320px) rotate(-324deg); }
|
| 86 |
</style>
|
| 87 |
""", unsafe_allow_html=True)
|
| 88 |
|
| 89 |
+
# Check current page and render content
|
| 90 |
+
if st.session_state.page == "Home":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
# Home Page Content
|
| 92 |
st.markdown('<h1>Life Cycle of End-to-End ML Project</h1>', unsafe_allow_html=True)
|
| 93 |
+
# Circular button layout
|
| 94 |
+
st.markdown("""
|
| 95 |
+
<div class="circle-container">
|
| 96 |
+
<div class="circle">
|
| 97 |
+
<div class="steps">
|
| 98 |
+
<div class="step" id="step1" onclick="document.querySelector('button[name=step1]').click()">Problem Statement</div>
|
| 99 |
+
<div class="step" id="step2" onclick="document.querySelector('button[name=step2]').click()">Data Collection</div>
|
| 100 |
+
<div class="step" id="step3" onclick="document.querySelector('button[name=step3]').click()">Simple EDA</div>
|
| 101 |
+
<div class="step" id="step4" onclick="document.querySelector('button[name=step4]').click()">Data Preprocessing</div>
|
| 102 |
+
<div class="step" id="step5" onclick="document.querySelector('button[name=step5]').click()">EDA</div>
|
| 103 |
+
<div class="step" id="step6" onclick="document.querySelector('button[name=step6]').click()">Feature Engineering</div>
|
| 104 |
+
<div class="step" id="step7" onclick="document.querySelector('button[name=step7]').click()">Model Training</div>
|
| 105 |
+
<div class="step" id="step8" onclick="document.querySelector('button[name=step8]').click()">Model Testing</div>
|
| 106 |
+
<div class="step" id="step9" onclick="document.querySelector('button[name=step9]').click()">Model Deployment</div>
|
| 107 |
+
<div class="step" id="step10" onclick="document.querySelector('button[name=step10]').click()">Monitoring</div>
|
| 108 |
+
</div>
|
| 109 |
</div>
|
| 110 |
+
</div>
|
| 111 |
+
""", unsafe_allow_html=True)
|
| 112 |
+
|
| 113 |
+
# Invisible buttons for navigation
|
| 114 |
+
if st.button("Problem Statement", key="step1"):
|
|
|
|
| 115 |
navigate_to("ProblemStatement")
|
| 116 |
+
if st.button("Data Collection", key="step2"):
|
| 117 |
navigate_to("DataCollection")
|
| 118 |
+
if st.button("Simple EDA", key="step3"):
|
| 119 |
navigate_to("SimpleEDA")
|
| 120 |
+
if st.button("Data Preprocessing", key="step4"):
|
| 121 |
navigate_to("DataPreprocessing")
|
| 122 |
+
if st.button("EDA", key="step5"):
|
| 123 |
navigate_to("EDA")
|
| 124 |
+
if st.button("Feature Engineering", key="step6"):
|
| 125 |
navigate_to("FeatureEngineering")
|
| 126 |
+
if st.button("Model Training", key="step7"):
|
| 127 |
navigate_to("ModelTraining")
|
| 128 |
+
if st.button("Model Testing", key="step8"):
|
| 129 |
navigate_to("ModelTesting")
|
| 130 |
+
if st.button("Model Deployment", key="step9"):
|
| 131 |
navigate_to("ModelDeployment")
|
| 132 |
+
if st.button("Monitoring", key="step10"):
|
| 133 |
navigate_to("Monitoring")
|
|
|
|
| 134 |
|
| 135 |
+
# Page content for each step
|
| 136 |
+
elif st.session_state.page == "ProblemStatement":
|
| 137 |
+
st.write("### Problem Statement")
|
| 138 |
+
st.write("Define the problem for the ML project.")
|
| 139 |
if st.button("Go Back"):
|
| 140 |
navigate_to("Home")
|
| 141 |
+
elif st.session_state.page == "DataCollection":
|
| 142 |
+
st.write("### Data Collection")
|
| 143 |
+
st.write("Collect data for the ML project.")
|
|
|
|
| 144 |
if st.button("Go Back"):
|
| 145 |
navigate_to("Home")
|
| 146 |
+
elif st.session_state.page == "SimpleEDA":
|
| 147 |
+
st.write("### Simple EDA")
|
| 148 |
+
st.write("Perform basic exploratory data analysis.")
|
|
|
|
| 149 |
if st.button("Go Back"):
|
| 150 |
navigate_to("Home")
|
| 151 |
+
# Add similar content for other pages...
|
| 152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|