Spaces:
Sleeping
Sleeping
Update pages/3_Life cycle of ML.py
Browse files- pages/3_Life cycle of ML.py +89 -0
pages/3_Life cycle of ML.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
from graphviz import Digraph
|
| 3 |
|
| 4 |
custom_css = """
|
|
@@ -91,3 +92,91 @@ for step in steps:
|
|
| 91 |
if selected_step:
|
| 92 |
st.markdown(f"<h2>{selected_step}</h2>", unsafe_allow_html=True)
|
| 93 |
st.markdown(f"<p style='font-size:1.1rem; text-align:center;'>{descriptions[selected_step]}</p>", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
from graphviz import Digraph
|
| 4 |
|
| 5 |
custom_css = """
|
|
|
|
| 92 |
if selected_step:
|
| 93 |
st.markdown(f"<h2>{selected_step}</h2>", unsafe_allow_html=True)
|
| 94 |
st.markdown(f"<p style='font-size:1.1rem; text-align:center;'>{descriptions[selected_step]}</p>", unsafe_allow_html=True)
|
| 95 |
+
|
| 96 |
+
st.markdown("<hr>", unsafe_allow_html=True)
|
| 97 |
+
|
| 98 |
+
for step in steps:
|
| 99 |
+
if st.button(step):
|
| 100 |
+
if step == "Data Collection":
|
| 101 |
+
st.experimental_set_query_params(page="Data Collection")
|
| 102 |
+
|
| 103 |
+
elif page == "Data Collection":
|
| 104 |
+
st.markdown("<h1>Data Collection</h1>", unsafe_allow_html=True)
|
| 105 |
+
st.markdown(
|
| 106 |
+
"<p>Data is the foundational aspect of any ML project. It comes in three primary types: "
|
| 107 |
+
"Structured, Unstructured, and Semi-Structured data.</p>",
|
| 108 |
+
unsafe_allow_html=True
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
if st.button("Structured Data"):
|
| 112 |
+
st.experimental_set_query_params(page="Structured Data: Excel")
|
| 113 |
+
|
| 114 |
+
elif page == "Structured Data: Excel":
|
| 115 |
+
st.markdown("<h1>Structured Data: Excel</h1>", unsafe_allow_html=True)
|
| 116 |
+
st.write("**What is Excel?**")
|
| 117 |
+
st.write("Excel files store data in a tabular format, widely used in business and analytics.")
|
| 118 |
+
|
| 119 |
+
st.write("**How to read Excel files:**")
|
| 120 |
+
st.code("""
|
| 121 |
+
# Load an Excel file
|
| 122 |
+
excel_data = pd.read_excel('file.xlsx')
|
| 123 |
+
""", language="python")
|
| 124 |
+
|
| 125 |
+
st.write("**Common issues:**")
|
| 126 |
+
st.write("- Missing headers or irregular data.")
|
| 127 |
+
st.write("- Multiple sheets requiring separate handling.")
|
| 128 |
+
|
| 129 |
+
st.write("**How to handle issues:**")
|
| 130 |
+
st.write("- Use `sheet_name` to specify sheets.")
|
| 131 |
+
st.code("""
|
| 132 |
+
data = pd.read_excel('file.xlsx', sheet_name='Sheet1')
|
| 133 |
+
""", language="python")
|
| 134 |
+
|
| 135 |
+
st.download_button("Download Documentation", "This is Excel-related documentation.", file_name="Excel_Guide.pdf")
|
| 136 |
+
|
| 137 |
+
elif page == "Structured Data: CSV":
|
| 138 |
+
st.markdown("<h1>Structured Data: CSV</h1>", unsafe_allow_html=True)
|
| 139 |
+
st.write("**What is CSV?**")
|
| 140 |
+
st.write("CSV files store data as plain text, where columns are separated by commas.")
|
| 141 |
+
|
| 142 |
+
st.write("**How to read CSV files:**")
|
| 143 |
+
st.code("""
|
| 144 |
+
import pandas as pd
|
| 145 |
+
# Load a CSV file
|
| 146 |
+
csv_data = pd.read_csv('file.csv')
|
| 147 |
+
""", language="python")
|
| 148 |
+
|
| 149 |
+
st.write("**Common issues:**")
|
| 150 |
+
st.write("- Encoding problems.")
|
| 151 |
+
st.write("- Missing values.")
|
| 152 |
+
|
| 153 |
+
st.write("**How to handle issues:**")
|
| 154 |
+
st.write("- Use `encoding` to handle encoding errors.")
|
| 155 |
+
st.code("""
|
| 156 |
+
data = pd.read_csv('file.csv', encoding='utf-8')
|
| 157 |
+
""", language="python")
|
| 158 |
+
|
| 159 |
+
st.download_button("Download Documentation", "This is CSV-related documentation.", file_name="CSV_Guide.pdf")
|
| 160 |
+
|
| 161 |
+
elif page == "Structured Data: XML":
|
| 162 |
+
st.markdown("<h1>Structured Data: XML</h1>", unsafe_allow_html=True)
|
| 163 |
+
st.write("**What is XML?**")
|
| 164 |
+
st.write("XML files store hierarchical data using tags.")
|
| 165 |
+
|
| 166 |
+
st.write("**How to read XML files:**")
|
| 167 |
+
st.code("""
|
| 168 |
+
# Parse XML data
|
| 169 |
+
from xml.etree import ElementTree
|
| 170 |
+
|
| 171 |
+
tree = ElementTree.parse('file.xml')
|
| 172 |
+
root = tree.getroot()
|
| 173 |
+
""", language="python")
|
| 174 |
+
|
| 175 |
+
st.write("**Common issues:**")
|
| 176 |
+
st.write("- Nested structures making data extraction complex.")
|
| 177 |
+
|
| 178 |
+
st.write("**How to handle issues:**")
|
| 179 |
+
st.write("- Use libraries like `xml.etree.ElementTree` or `lxml` for parsing.")
|
| 180 |
+
|
| 181 |
+
st.download_button("Download Documentation", "This is XML-related documentation.", file_name="XML_Guide.pdf")
|
| 182 |
+
|