Create Life Cycle of ML.py
Browse files- pages/Life Cycle of ML.py +72 -0
pages/Life Cycle of ML.py
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Main Application File (app.py)
|
3 |
+
python
|
4 |
+
Copy code
|
5 |
+
import streamlit as st
|
6 |
+
import os
|
7 |
+
|
8 |
+
# Sidebar for navigation
|
9 |
+
st.sidebar.title("Navigation")
|
10 |
+
page = st.sidebar.radio("Go to:", ["Life Cycle of ML", "Data Collection"])
|
11 |
+
|
12 |
+
if page == "Life Cycle of ML":
|
13 |
+
st.title("Life Cycle of Machine Learning")
|
14 |
+
st.write("Explore the steps involved in the Machine Learning lifecycle.")
|
15 |
+
if st.button("Data Collection"):
|
16 |
+
st.experimental_set_query_params(page="data_collection")
|
17 |
+
|
18 |
+
elif page == "Data Collection":
|
19 |
+
st.title("Data Collection")
|
20 |
+
st.write("Explore the types of data and formats involved in Machine Learning.")
|
21 |
+
st.write("### Types of Data:")
|
22 |
+
data_type = st.radio("Choose a data type:", ["Structured", "Unstructured", "Semi-Structured"])
|
23 |
+
|
24 |
+
if data_type == "Structured":
|
25 |
+
st.write("### Structured Data Formats:")
|
26 |
+
format_selected = st.radio("Choose a data format:", ["Excel", "CSV", "SQL Database"])
|
27 |
+
if format_selected == "Excel":
|
28 |
+
st.experimental_set_query_params(page="structured_excel")
|
29 |
+
|
30 |
+
# Handling query parameters for structured data navigation
|
31 |
+
query_params = st.experimental_get_query_params()
|
32 |
+
if query_params.get("page", [None])[0] == "structured_excel":
|
33 |
+
st.title("Excel Data Format")
|
34 |
+
st.write("#### What is Excel?")
|
35 |
+
st.write("""
|
36 |
+
Excel is a widely used file format for storing structured data in tabular format.
|
37 |
+
Common extensions include `.xlsx` and `.xls`.
|
38 |
+
""")
|
39 |
+
|
40 |
+
st.write("#### How to Read Excel Files?")
|
41 |
+
st.code("""
|
42 |
+
import pandas as pd
|
43 |
+
df = pd.read_excel("file.xlsx")
|
44 |
+
print(df.head())
|
45 |
+
""")
|
46 |
+
|
47 |
+
st.write("#### Common Issues with Excel Files:")
|
48 |
+
st.markdown("""
|
49 |
+
- Missing data or corrupted files
|
50 |
+
- Encoding issues
|
51 |
+
- Unsupported Excel versions
|
52 |
+
""")
|
53 |
+
|
54 |
+
st.write("#### How to Overcome These Issues?")
|
55 |
+
st.markdown("""
|
56 |
+
- Use data validation tools to clean Excel files.
|
57 |
+
- Specify encoding explicitly when reading files.
|
58 |
+
- Convert to a supported format if needed.
|
59 |
+
""")
|
60 |
+
|
61 |
+
# Button to download a Jupyter Notebook or PDF
|
62 |
+
st.markdown("### Download Coding Guide:")
|
63 |
+
if st.button("Download Jupyter Notebook"):
|
64 |
+
# Provide a downloadable file
|
65 |
+
file_path = "Excel_guide.ipynb" # Ensure this file exists in the app directory
|
66 |
+
with open(file_path, "rb") as file:
|
67 |
+
st.download_button(
|
68 |
+
label="Download Excel Guide",
|
69 |
+
data=file,
|
70 |
+
file_name="Excel_guide.ipynb",
|
71 |
+
mime="application/octet-stream",
|
72 |
+
)
|