LakshmiHarika commited on
Commit
a4add00
Β·
verified Β·
1 Parent(s): c80b2c7

Update pages/3Life Cycle of Machine Learning Project.py

Browse files
pages/3Life Cycle of Machine Learning Project.py CHANGED
@@ -46,56 +46,80 @@ st.markdown("""
46
 
47
 
48
  import streamlit as st
49
- from streamlit.components.v1 import html
50
 
51
- # Function to create a centered step with a rectangle and direct page navigation
52
- def centered_step(label, page, color, is_last=False):
53
- col1, col2, col3 = st.columns([1, 3, 1]) # Center layout
54
- with col2:
55
- button_html = f"""
56
- <div style="text-align: center;">
57
- <a href="{page}" target="_self" style="
58
- display: inline-block;
59
- background: linear-gradient(to right, {color[0]}, {color[1]});
60
- color: white;
61
- padding: 15px 20px;
62
- text-decoration: none;
63
- font-size: 18px;
64
- font-weight: bold;
65
- border-radius: 8px;
66
- box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
67
- ">
68
- {label}
69
- </a>
70
- </div>
71
- """
72
- html(button_html, height=50)
73
-
74
- # Display the arrow between steps
75
- if not is_last:
76
- col1, col2, col3 = st.columns([1, 3, 1])
77
- with col2:
78
- st.markdown(
79
- """
80
- <div style="text-align: center; margin: -10px;">
81
- <span style="font-size: 40px; color: green;">⬇️</span>
82
- </div>
83
- """,
84
- unsafe_allow_html=True,
85
- )
86
-
87
- # Title
88
- st.title("Machine Learning Workflow")
89
- st.write("Click a step to navigate to its page.")
 
 
 
 
 
 
 
 
 
90
 
91
- # Display centered steps with arrows
92
- centered_step("Problem Statement", "/page1", ["#4A90E2", "#0056B3"]) # Blue gradient
93
- centered_step("Data Collection", "/page2", ["#F25C54", "#FF5733"]) # Red gradient
94
- centered_step("Simple EDA", "/page3", ["#F7C948", "#FFC300"]) # Yellow gradient
95
- centered_step("Data Pre-processing", "/page4", ["#00B159", "#009688"]) # Green gradient
96
- centered_step("EDA", "/page5", ["#D76AC3", "#C70039"]) # Pink gradient
97
- centered_step("Feature Engineering", "/page6", ["#6A4C93", "#5D3FD3"]) # Purple gradient
98
- centered_step("Model Building", "/page7", ["#F25C54", "#E53935"]) # Another red gradient
99
- centered_step("Evaluation", "/page8", ["#4A90E2", "#1565C0"]) # Another blue gradient
100
- centered_step("Deployment", "/page9", ["#00B159", "#43A047"]) # Another green gradient
101
- centered_step("Monitoring", "/page10", ["#D76AC3", "#8E24AA"], is_last=True) # Another purple gradient
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
 
48
  import streamlit as st
 
49
 
50
+ # Inject custom CSS
51
+ st.markdown(
52
+ """
53
+ <style>
54
+ /* Container for the flowchart */
55
+ .flowchart-container {
56
+ display: flex;
57
+ flex-direction: column;
58
+ align-items: center;
59
+ gap: 20px;
60
+ margin-top: 50px;
61
+ }
62
+ /* Styling for each phase button */
63
+ .phase {
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ width: 280px;
68
+ height: 60px;
69
+ background: linear-gradient(to right, #4CAF50, #2E7D32);
70
+ color: white;
71
+ font-size: 16px;
72
+ font-weight: bold;
73
+ text-align: center;
74
+ border-radius: 10px;
75
+ cursor: pointer;
76
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
77
+ transition: transform 0.3s ease, background 0.3s ease;
78
+ font-family: 'Arial', sans-serif;
79
+ text-decoration: none;
80
+ }
81
+ /* Hover effect */
82
+ .phase:hover {
83
+ transform: scale(1.05);
84
+ background: linear-gradient(to right, #FF7043, #D32F2F);
85
+ }
86
+ /* Arrow styling */
87
+ .arrow {
88
+ width: 20px;
89
+ height: 20px;
90
+ border-bottom: 4px solid #4CAF50;
91
+ border-right: 4px solid #4CAF50;
92
+ transform: rotate(45deg);
93
+ }
94
+ </style>
95
+ """,
96
+ unsafe_allow_html=True,
97
+ )
98
 
99
+ # HTML for the flowchart structure
100
+ st.markdown(
101
+ """
102
+ <div class="flowchart-container">
103
+ <a class="phase" href="/page1" target="_self">πŸ“Œ Problem Statement</a>
104
+ <div class="arrow"></div>
105
+ <a class="phase" href="/page2" target="_self">πŸ“Š Data Collection</a>
106
+ <div class="arrow"></div>
107
+ <a class="phase" href="/page3" target="_self">πŸ” Simple EDA</a>
108
+ <div class="arrow"></div>
109
+ <a class="phase" href="/page4" target="_self">βš™οΈ Data Pre-processing</a>
110
+ <div class="arrow"></div>
111
+ <a class="phase" href="/page5" target="_self">πŸ“ˆ EDA</a>
112
+ <div class="arrow"></div>
113
+ <a class="phase" href="/page6" target="_self">πŸ› οΈ Feature Engineering</a>
114
+ <div class="arrow"></div>
115
+ <a class="phase" href="/page7" target="_self">πŸ€– Training the Model</a>
116
+ <div class="arrow"></div>
117
+ <a class="phase" href="/page8" target="_self">βœ… Testing the Model</a>
118
+ <div class="arrow"></div>
119
+ <a class="phase" href="/page9" target="_self">☁️ Deployment</a>
120
+ <div class="arrow"></div>
121
+ <a class="phase" href="/page10" target="_self">πŸ“Š Monitoring</a>
122
+ </div>
123
+ """,
124
+ unsafe_allow_html=True,
125
+ )