Spaces:
Sleeping
Sleeping
Update pages/Life cycle of ML.py
Browse files- pages/Life cycle of ML.py +0 -135
pages/Life cycle of ML.py
CHANGED
|
@@ -1,135 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
import streamlit as st
|
| 4 |
-
|
| 5 |
-
if "current_page" not in st.session_state:
|
| 6 |
-
st.session_state.current_page = "home"
|
| 7 |
-
|
| 8 |
-
def navigate_to(page):
|
| 9 |
-
st.session_state.current_page = page
|
| 10 |
-
|
| 11 |
-
# Define CSS styling
|
| 12 |
-
def set_css():
|
| 13 |
-
st.markdown("""
|
| 14 |
-
<style>
|
| 15 |
-
.graph-container {
|
| 16 |
-
display: flex;
|
| 17 |
-
flex-direction: column;
|
| 18 |
-
align-items: center;
|
| 19 |
-
}
|
| 20 |
-
.graph-node {
|
| 21 |
-
border: 2px solid #4CAF50;
|
| 22 |
-
border-radius: 50%;
|
| 23 |
-
width: 100px;
|
| 24 |
-
height: 100px;
|
| 25 |
-
display: flex;
|
| 26 |
-
justify-content: center;
|
| 27 |
-
align-items: center;
|
| 28 |
-
margin: 20px;
|
| 29 |
-
font-weight: bold;
|
| 30 |
-
color: white;
|
| 31 |
-
background-color: #4CAF50;
|
| 32 |
-
cursor: pointer;
|
| 33 |
-
box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
|
| 34 |
-
transition: transform 0.3s, background-color 0.3s;
|
| 35 |
-
}
|
| 36 |
-
.graph-node:hover {
|
| 37 |
-
background-color: #45a049;
|
| 38 |
-
transform: scale(1.1);
|
| 39 |
-
}
|
| 40 |
-
.graph-line {
|
| 41 |
-
width: 2px;
|
| 42 |
-
height: 50px;
|
| 43 |
-
background-color: #4CAF50;
|
| 44 |
-
margin: 0 auto;
|
| 45 |
-
}
|
| 46 |
-
</style>
|
| 47 |
-
""", unsafe_allow_html=True)
|
| 48 |
-
|
| 49 |
-
# Home Page
|
| 50 |
-
def home_page():
|
| 51 |
-
set_css()
|
| 52 |
-
st.title("🚀 Machine Learning Lifecycle")
|
| 53 |
-
|
| 54 |
-
st.markdown('<div class="graph-container">', unsafe_allow_html=True)
|
| 55 |
-
|
| 56 |
-
if st.button("1. Problem Definition", key="node1"):
|
| 57 |
-
navigate_to("problem_definition")
|
| 58 |
-
st.markdown('<div class="graph-line"></div>', unsafe_allow_html=True)
|
| 59 |
-
|
| 60 |
-
if st.button("2. Data Collection", key="node2"):
|
| 61 |
-
navigate_to("data_collection")
|
| 62 |
-
st.markdown('<div class="graph-line"></div>', unsafe_allow_html=True)
|
| 63 |
-
|
| 64 |
-
if st.button("3. Data Preparation", key="node3"):
|
| 65 |
-
navigate_to("data_preparation")
|
| 66 |
-
st.markdown('<div class="graph-line"></div>', unsafe_allow_html=True)
|
| 67 |
-
|
| 68 |
-
if st.button("4. Modeling", key="node4"):
|
| 69 |
-
navigate_to("modeling")
|
| 70 |
-
st.markdown('<div class="graph-line"></div>', unsafe_allow_html=True)
|
| 71 |
-
|
| 72 |
-
if st.button("5. Evaluation", key="node5"):
|
| 73 |
-
navigate_to("evaluation")
|
| 74 |
-
st.markdown('<div class="graph-line"></div>', unsafe_allow_html=True)
|
| 75 |
-
|
| 76 |
-
if st.button("6. Deployment", key="node6"):
|
| 77 |
-
navigate_to("deployment")
|
| 78 |
-
|
| 79 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
| 80 |
-
|
| 81 |
-
# Pages for each stage
|
| 82 |
-
def problem_definition_page():
|
| 83 |
-
st.title("📌 Problem Definition")
|
| 84 |
-
st.write("Define the problem you are solving with your machine learning model.")
|
| 85 |
-
if st.button("⬅️ Back to Home"):
|
| 86 |
-
navigate_to("home")
|
| 87 |
-
|
| 88 |
-
def data_collection_page():
|
| 89 |
-
st.title("📊 Data Collection")
|
| 90 |
-
st.write("Gather data relevant to the problem.")
|
| 91 |
-
if st.button("⬅️ Back to Home"):
|
| 92 |
-
navigate_to("home")
|
| 93 |
-
|
| 94 |
-
def data_preparation_page():
|
| 95 |
-
st.title("🔧 Data Preparation")
|
| 96 |
-
st.write("Clean and preprocess the data for analysis.")
|
| 97 |
-
if st.button("⬅️ Back to Home"):
|
| 98 |
-
navigate_to("home")
|
| 99 |
-
|
| 100 |
-
def modeling_page():
|
| 101 |
-
st.title("🤖 Modeling")
|
| 102 |
-
st.write("Train and tune machine learning models.")
|
| 103 |
-
if st.button("⬅️ Back to Home"):
|
| 104 |
-
navigate_to("home")
|
| 105 |
-
|
| 106 |
-
def evaluation_page():
|
| 107 |
-
st.title("📈 Evaluation")
|
| 108 |
-
st.write("Evaluate model performance using appropriate metrics.")
|
| 109 |
-
if st.button("⬅️ Back to Home"):
|
| 110 |
-
navigate_to("home")
|
| 111 |
-
|
| 112 |
-
def deployment_page():
|
| 113 |
-
st.title("🌐 Deployment")
|
| 114 |
-
st.write("Deploy the model to production for real-world use.")
|
| 115 |
-
if st.button("⬅️ Back to Home"):
|
| 116 |
-
navigate_to("home")
|
| 117 |
-
|
| 118 |
-
def main():
|
| 119 |
-
if st.session_state.current_page == "home":
|
| 120 |
-
home_page()
|
| 121 |
-
elif st.session_state.current_page == "problem_definition":
|
| 122 |
-
problem_definition_page()
|
| 123 |
-
elif st.session_state.current_page == "data_collection":
|
| 124 |
-
data_collection_page()
|
| 125 |
-
elif st.session_state.current_page == "data_preparation":
|
| 126 |
-
data_preparation_page()
|
| 127 |
-
elif st.session_state.current_page == "modeling":
|
| 128 |
-
modeling_page()
|
| 129 |
-
elif st.session_state.current_page == "evaluation":
|
| 130 |
-
evaluation_page()
|
| 131 |
-
elif st.session_state.current_page == "deployment":
|
| 132 |
-
deployment_page()
|
| 133 |
-
|
| 134 |
-
if __name__ == "__main__":
|
| 135 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|