Spaces:
Sleeping
Sleeping
Update pages/3Life Cycle of Machine Learning Project.py
Browse files
pages/3Life Cycle of Machine Learning Project.py
CHANGED
|
@@ -1,177 +1,129 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
<style>
|
| 12 |
-
body, .stApp {
|
| 13 |
-
color: #4F4F4F;
|
| 14 |
-
background-color: #FFFFFF;
|
| 15 |
-
}
|
| 16 |
-
h1, h2, h3, h4, h5, h6 {
|
| 17 |
-
color: #BB3385;
|
| 18 |
-
}
|
| 19 |
-
p {
|
| 20 |
-
color: #4F4F4F;
|
| 21 |
-
}
|
| 22 |
-
ul li {
|
| 23 |
-
color: #4F4F4F;
|
| 24 |
-
}
|
| 25 |
-
</style>
|
| 26 |
-
""", unsafe_allow_html=True)
|
| 27 |
-
|
| 28 |
-
st.markdown(
|
| 29 |
-
"""
|
| 30 |
-
<style>
|
| 31 |
-
.stApp {
|
| 32 |
-
background-image: url("https://huggingface.co/spaces/LakshmiHarika/MachineLearning/resolve/main/DALL%C2%B7E%202024-12-03%2023.34.47%20-%20A%20simple%20and%20elegant%20background%20image%20for%20an%20AI-themed%20web%20application.%20The%20background%20should%20feature%20a%20soft%20gradient%20transitioning%20from%20white%20to%20ligh.webp");
|
| 33 |
-
background-size: cover;
|
| 34 |
-
background-repeat: no-repeat;
|
| 35 |
-
background-attachment: fixed;
|
| 36 |
-
}
|
| 37 |
-
</style>
|
| 38 |
-
""",
|
| 39 |
-
unsafe_allow_html=True
|
| 40 |
-
)
|
| 41 |
-
|
| 42 |
-
# Title of the page
|
| 43 |
-
st.markdown("""<div style="text-align: center; margin-top: 20px;"><h1 style="color: #BB3385;">Life Cycle of End to End ML Project</h1></div>""", unsafe_allow_html=True)
|
| 44 |
-
|
| 45 |
-
# Custom CSS for circular flowchart layout
|
| 46 |
-
st.markdown(
|
| 47 |
-
"""
|
| 48 |
<style>
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
position: relative;
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
border-radius: 50%;
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
-
|
| 57 |
-
.circle-container .phase {
|
| 58 |
position: absolute;
|
| 59 |
-
width:
|
| 60 |
-
height:
|
| 61 |
-
font-size: 16px;
|
| 62 |
-
font-weight: bold;
|
| 63 |
-
text-align: center;
|
| 64 |
display: flex;
|
| 65 |
justify-content: center;
|
| 66 |
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
border-radius: 8px;
|
| 68 |
cursor: pointer;
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
.phase-1 { background-color: #FF6F61; }
|
| 76 |
-
.phase-2 { background-color: #4C9F70; }
|
| 77 |
-
.phase-3 { background-color: #2F8ED6; }
|
| 78 |
-
.phase-4 { background-color: #F1C40F; }
|
| 79 |
-
.phase-5 { background-color: #9B59B6; }
|
| 80 |
-
.phase-6 { background-color: #E74C3C; }
|
| 81 |
-
.phase-7 { background-color: #1ABC9C; }
|
| 82 |
-
.phase-8 { background-color: #F39C12; }
|
| 83 |
-
.phase-9 { background-color: #D35400; }
|
| 84 |
-
.phase-10 { background-color: #8E44AD; }
|
| 85 |
-
|
| 86 |
-
/* Hover effect */
|
| 87 |
-
.phase:hover {
|
| 88 |
-
transform: scale(1.05);
|
| 89 |
-
background-color: #F0F0F0;
|
| 90 |
-
color: black;
|
| 91 |
}
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
}
|
| 104 |
-
|
| 105 |
</style>
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
<!-- Simple EDA -->
|
| 125 |
-
<a href="javascript:void(0)" class="phase phase-3" style="top: 100%; left: 50%; transform: translateX(-50%) rotate(72deg);"
|
| 126 |
-
onclick="toggleDescription('desc3')">Simple EDA</a>
|
| 127 |
-
<div id="desc3" class="description">Perform initial exploratory analysis to assess data quality, structure, and appearance.</div>
|
| 128 |
-
|
| 129 |
-
<!-- Data Preprocessing -->
|
| 130 |
-
<a href="javascript:void(0)" class="phase phase-4" style="top: 50%; right: 0; transform: translateY(-50%) rotate(108deg);"
|
| 131 |
-
onclick="toggleDescription('desc4')">Data Preprocessing</a>
|
| 132 |
-
<div id="desc4" class="description">Clean the dataset by handling missing values, outliers, and inconsistencies, transforming it into a suitable format.</div>
|
| 133 |
-
|
| 134 |
-
<!-- EDA -->
|
| 135 |
-
<a href="javascript:void(0)" class="phase phase-5" style="top: 0; right: 50%; transform: translateX(50%) rotate(144deg);"
|
| 136 |
-
onclick="toggleDescription('desc5')">EDA</a>
|
| 137 |
-
<div id="desc5" class="description">Perform detailed analysis to uncover trends, patterns, and relationships that will guide model building.</div>
|
| 138 |
-
|
| 139 |
-
<!-- Feature Engineering -->
|
| 140 |
-
<a href="javascript:void(0)" class="phase phase-6" style="top: 100%; right: 50%; transform: translateX(-50%) rotate(180deg);"
|
| 141 |
-
onclick="toggleDescription('desc6')">Feature Engineering</a>
|
| 142 |
-
<div id="desc6" class="description">Create or select meaningful features, scale variables, and reduce dimensionality to enhance model performance.</div>
|
| 143 |
-
|
| 144 |
-
<!-- Model Training -->
|
| 145 |
-
<a href="javascript:void(0)" class="phase phase-7" style="top: 50%; right: 50%; transform: translateY(-50%) rotate(216deg);"
|
| 146 |
-
onclick="toggleDescription('desc7')">Model Training</a>
|
| 147 |
-
<div id="desc7" class="description">Train machine learning models on the prepared data and optimize parameters for improved performance.</div>
|
| 148 |
-
|
| 149 |
-
<!-- Model Testing -->
|
| 150 |
-
<a href="javascript:void(0)" class="phase phase-8" style="top: 50%; left: 50%; transform: translateY(-50%) rotate(252deg);"
|
| 151 |
-
onclick="toggleDescription('desc8')">Model Testing</a>
|
| 152 |
-
<div id="desc8" class="description">Evaluate the trained model on a validation or test dataset to assess accuracy, precision, and other metrics.</div>
|
| 153 |
-
|
| 154 |
-
<!-- Deployment -->
|
| 155 |
-
<a href="javascript:void(0)" class="phase phase-9" style="top: 50%; left: 0; transform: translateY(-50%) rotate(288deg);"
|
| 156 |
-
onclick="toggleDescription('desc9')">Deployment</a>
|
| 157 |
-
<div id="desc9" class="description">Deploy the trained model into a live system for real-time or batch processing of new data.</div>
|
| 158 |
-
|
| 159 |
-
<!-- Monitoring -->
|
| 160 |
-
<a href="javascript:void(0)" class="phase phase-10" style="top: 50%; left: 0; transform: translateY(-50%) rotate(324deg);"
|
| 161 |
-
onclick="toggleDescription('desc10')">Monitoring</a>
|
| 162 |
-
<div id="desc10" class="description">Track model performance in production, addressing issues like data drift and performance degradation.</div>
|
| 163 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
var desc = document.getElementById(id);
|
| 168 |
-
if (desc.style.display === "block") {
|
| 169 |
-
desc.style.display = "none";
|
| 170 |
-
} else {
|
| 171 |
-
desc.style.display = "block";
|
| 172 |
-
}
|
| 173 |
-
}
|
| 174 |
-
</script>
|
| 175 |
-
""",
|
| 176 |
-
unsafe_allow_html=True
|
| 177 |
-
)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
|
| 3 |
+
# Define the HTML code for the circular flowchart
|
| 4 |
+
html_code = """
|
| 5 |
+
<!DOCTYPE html>
|
| 6 |
+
<html lang="en">
|
| 7 |
+
<head>
|
| 8 |
+
<meta charset="UTF-8">
|
| 9 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 10 |
+
<title>Machine Learning Project Life Cycle</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
<style>
|
| 12 |
+
body {
|
| 13 |
+
font-family: Arial, sans-serif;
|
| 14 |
+
display: flex;
|
| 15 |
+
justify-content: center;
|
| 16 |
+
align-items: center;
|
| 17 |
+
height: 100vh;
|
| 18 |
+
margin: 0;
|
| 19 |
+
background-color: #f4f4f9;
|
| 20 |
+
}
|
| 21 |
+
.container {
|
| 22 |
+
text-align: center;
|
| 23 |
+
width: 80%;
|
| 24 |
+
max-width: 800px;
|
| 25 |
+
}
|
| 26 |
+
.circle {
|
| 27 |
position: relative;
|
| 28 |
+
width: 350px;
|
| 29 |
+
height: 350px;
|
| 30 |
+
margin: 20px auto;
|
| 31 |
border-radius: 50%;
|
| 32 |
+
display: flex;
|
| 33 |
+
justify-content: center;
|
| 34 |
+
align-items: center;
|
| 35 |
}
|
| 36 |
+
.steps {
|
|
|
|
| 37 |
position: absolute;
|
| 38 |
+
width: 100%;
|
| 39 |
+
height: 100%;
|
|
|
|
|
|
|
|
|
|
| 40 |
display: flex;
|
| 41 |
justify-content: center;
|
| 42 |
align-items: center;
|
| 43 |
+
flex-wrap: wrap;
|
| 44 |
+
}
|
| 45 |
+
.step {
|
| 46 |
+
background-color: #007bff;
|
| 47 |
+
color: white;
|
| 48 |
+
padding: 15px 30px;
|
| 49 |
border-radius: 8px;
|
| 50 |
cursor: pointer;
|
| 51 |
+
width: 150px;
|
| 52 |
+
margin: 10px;
|
| 53 |
+
text-align: center;
|
| 54 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 55 |
+
transition: background-color 0.3s;
|
| 56 |
+
position: absolute;
|
| 57 |
+
transform-origin: 50% 50%;
|
| 58 |
+
transition: transform 0.5s ease-in-out;
|
| 59 |
}
|
| 60 |
+
.step:hover {
|
| 61 |
+
background-color: #0056b3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
+
/* Different background colors for each step */
|
| 64 |
+
#step1 {
|
| 65 |
+
background-color: #ff5733;
|
| 66 |
+
transform: rotate(0deg) translateX(140px) rotate(0deg);
|
| 67 |
+
}
|
| 68 |
+
#step2 {
|
| 69 |
+
background-color: #33b5ff;
|
| 70 |
+
transform: rotate(36deg) translateX(140px) rotate(-36deg);
|
| 71 |
+
}
|
| 72 |
+
#step3 {
|
| 73 |
+
background-color: #33ff57;
|
| 74 |
+
transform: rotate(72deg) translateX(140px) rotate(-72deg);
|
| 75 |
+
}
|
| 76 |
+
#step4 {
|
| 77 |
+
background-color: #ff33cc;
|
| 78 |
+
transform: rotate(108deg) translateX(140px) rotate(-108deg);
|
| 79 |
+
}
|
| 80 |
+
#step5 {
|
| 81 |
+
background-color: #ffcc33;
|
| 82 |
+
transform: rotate(144deg) translateX(140px) rotate(-144deg);
|
| 83 |
+
}
|
| 84 |
+
#step6 {
|
| 85 |
+
background-color: #33ccff;
|
| 86 |
+
transform: rotate(180deg) translateX(140px) rotate(-180deg);
|
| 87 |
+
}
|
| 88 |
+
#step7 {
|
| 89 |
+
background-color: #ff33a1;
|
| 90 |
+
transform: rotate(216deg) translateX(140px) rotate(-216deg);
|
| 91 |
+
}
|
| 92 |
+
#step8 {
|
| 93 |
+
background-color: #66ff33;
|
| 94 |
+
transform: rotate(252deg) translateX(140px) rotate(-252deg);
|
| 95 |
+
}
|
| 96 |
+
#step9 {
|
| 97 |
+
background-color: #9933ff;
|
| 98 |
+
transform: rotate(288deg) translateX(140px) rotate(-288deg);
|
| 99 |
+
}
|
| 100 |
+
#step10 {
|
| 101 |
+
background-color: #f7a500;
|
| 102 |
+
transform: rotate(324deg) translateX(140px) rotate(-324deg);
|
| 103 |
}
|
|
|
|
| 104 |
</style>
|
| 105 |
+
</head>
|
| 106 |
+
<body>
|
| 107 |
+
<div class="container">
|
| 108 |
+
<h1>Machine Learning Project Life Cycle</h1>
|
| 109 |
+
<div class="circle">
|
| 110 |
+
<div class="steps">
|
| 111 |
+
<div class="step" id="step1">1. Problem Statement</div>
|
| 112 |
+
<div class="step" id="step2">2. Data Collection</div>
|
| 113 |
+
<div class="step" id="step3">3. Simple EDA</div>
|
| 114 |
+
<div class="step" id="step4">4. Data Pre-Processing</div>
|
| 115 |
+
<div class="step" id="step5">5. EDA</div>
|
| 116 |
+
<div class="step" id="step6">6. Feature Engineering</div>
|
| 117 |
+
<div class="step" id="step7">7. Training the Model</div>
|
| 118 |
+
<div class="step" id="step8">8. Testing the Data</div>
|
| 119 |
+
<div class="step" id="step9">9. Deployment</div>
|
| 120 |
+
<div class="step" id="step10">10. Monitoring</div>
|
| 121 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</body>
|
| 125 |
+
</html>
|
| 126 |
+
"""
|
| 127 |
|
| 128 |
+
# Streamlit: Display the HTML circle with properly spaced steps
|
| 129 |
+
st.markdown(html_code, unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|