machineLearning / home.py
yash-gupta-01's picture
Update home.py
cf519ac verified
import streamlit as st
from streamlit_lottie import st_lottie
import requests
def load_lottieurl(url: str):
"""Fetch Lottie animation JSON from a URL."""
try:
response = requests.get(url)
if response.status_code == 200:
return response.json()
except requests.exceptions.RequestException:
return None
# ========== UPDATED CSS ==========
st.markdown("""
<style>
:root {
--background-color: #f8f9fa;
--text-color: #212529;
--primary-color: #007acc;
--secondary-color: #005b96;
--card-bg: #ffffff;
--text-muted: #6c757d;
}
@media (prefers-color-scheme: dark) {
:root {
--background-color: #0e1117;
--text-color: #e5e5e5;
--primary-color: #29b6f6;
--secondary-color: #90caf9;
--card-bg: #1f2937;
--text-muted: #a3a3a3;
}
}
body {
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
background-color: var(--background-color) !important;
color: var(--text-color) !important;
}
h1 {
font-size: 2.5rem !important;
color: var(--primary-color) !important;
text-align: center;
margin-bottom: 15px;
border-bottom: 2px solid var(--primary-color);
padding-bottom: 0.5rem;
}
h2 {
font-size: 2rem !important;
color: var(--secondary-color) !important;
margin: 1.5rem 0 1rem !important;
}
h3 {
font-size: 1.5rem !important;
margin: 1rem 0 0.5rem !important;
}
p {
font-family: 'Georgia', serif;
color: var(--text-color) !important;
line-height: 1.6;
text-align: justify;
}
.content-block {
margin: 1.5rem 0;
padding: 1.5rem;
background: var(--card-bg);
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.about-author {
background-color: var(--card-bg) !important;
border-radius: 10px;
padding: 25px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin: 20px auto;
max-width: 700px;
text-align: center;
color: var(--text-color) !important;
}
.social-icons {
display: flex;
justify-content: center;
gap: 20px;
margin-top: 15px;
}
.social-icons a img {
width: 40px;
height: 40px;
transition: transform 0.3s ease-in-out;
}
.social-icons a img:hover {
transform: scale(1.2);
}
footer {
margin-top: 50px;
text-align: center;
font-family: 'Georgia', serif;
color: var(--text-muted) !important;
}
.css-1d391kg, .css-1d391kg * {
background-color: var(--card-bg) !important;
color: var(--text-color) !important;
}
</style>
""", unsafe_allow_html=True)
# ========== NAVIGATION (UNCHANGED) ==========
chapters = [
"Foundation", "ML Project Lifecycle", "Core Algorithms", "Model Evaluation",
"Data Handling", "Computer Vision Basics", "Natural Language Processing (NLP)",
"Deployment & Tools"
]
selected_chapter = st.sidebar.radio("Select Chapter", chapters)
if selected_chapter == "Foundation":
foundation_main = st.sidebar.radio("Select Page", [
"Home", "Introduction to Data Science", "Machine Learning vs Deep Learning"
])
if foundation_main == "Introduction to Data Science":
selected_subtopic = st.sidebar.radio("Explore More", [
"Understanding Intelligence", "AI Tools: ML, DL, and Gen‑AI",
"Real‑Life Analogies and Examples", "What is Data Science?",
"The Role of a Data Scientist", "Why AI and Data Science Matter", "Did You Know?"
])
elif foundation_main == "Machine Learning vs Deep Learning":
st.sidebar.radio("Explore Comparison", [
"Understanding Machine Learning and Deep Learning", "Comparison Table for ML vs DL"
])
# Other navigation sections remain unchanged...
# ========== CONTENT RENDERING ==========
content_rendered = False
if selected_chapter == "Foundation" and foundation_main == "Introduction to Data Science":
content_rendered = True
if selected_subtopic == "Understanding Intelligence":
st.markdown("# 🧠 Understanding Intelligence")
with st.container():
st.markdown("### Natural vs Artificial Intelligence")
st.markdown("""
<div class="content-block">
<h3 style='color: var(--primary-color);'>Natural Intelligence 🐾</h3>
<p>Innate cognitive abilities found in living organisms:</p>
<ul>
<li>Dogs learning commands through repetition</li>
<li>Human problem-solving capabilities</li>
<li>Bird migration patterns</li>
</ul>
</div>
<div class="content-block">
<h3 style='color: var(--primary-color);'>Artificial Intelligence 🤖</h3>
<p>Machine-based systems demonstrating intelligent behavior:</p>
<ul>
<li>Netflix's recommendation engine</li>
<li>Google Maps traffic predictions</li>
<li>Voice assistants like Alexa</li>
</ul>
</div>
""", unsafe_allow_html=True)
elif selected_subtopic == "AI Tools: ML, DL, and Gen‑AI":
st.markdown("# 🔧 AI Toolkit Breakdown")
with st.container():
st.markdown("""
<div class="content-block">
<h3>Machine Learning (ML)</h3>
<p>🎯 <strong>Purpose:</strong> Pattern recognition & decision making</p>
<p>👶 <strong>Analogy:</strong> Teaching toddler to recognize fruits</p>
<p>🚀 <strong>Applications:</strong></p>
<ul>
<li>Spam email filtering</li>
<li>Stock price prediction</li>
<li>Customer churn analysis</li>
</ul>
</div>
""", unsafe_allow_html=True)
with st.container():
st.markdown("""
<div class="content-block">
<h3>Deep Learning (DL)</h3>
<p>🎯 <strong>Purpose:</strong> Complex data processing</p>
<p>🧠 <strong>Structure:</strong> Neural networks with multiple layers</p>
<p>🚀 <strong>Applications:</strong></p>
<ul>
<li>Facial recognition systems</li>
<li>Medical image analysis</li>
<li>Voice-controlled assistants</li>
</ul>
</div>
""", unsafe_allow_html=True)
# Other subtopics updated similarly...
# ========== HOME PAGE CONTENT ==========
if not content_rendered:
st.markdown("# Mastering Machine Learning: From Basics To Brilliance 🚀🤖")
st.markdown("## Your Gateway to Data Science Mastery")
lottie_animation = load_lottieurl("https://lottie.host/a45f4739-ef78-4193-b3f9-2ea435a190d5/PsTVRgXekn.json")
if lottie_animation:
st_lottie(lottie_animation, height=250)
with st.container():
st.markdown("## About This Application")
st.markdown("""
<div class="content-block">
A comprehensive learning platform covering:
<ul>
<li><strong>Fundamental Concepts:</strong> Build strong theoretical foundations</li>
<li><strong>Practical Implementation:</strong> Real-world project workflows</li>
<li><strong>Industry Best Practices:</strong> Professional development techniques</li>
</ul>
</div>
""", unsafe_allow_html=True)
# Author Section
st.markdown("""
<div class="about-author">
<h2>About the Author</h2>
<p>
Hello! I'm <strong>Yash Harish Gupta</strong>, an aspiring data scientist
passionate about transforming raw data into actionable insights through
machine learning and AI technologies.
</p>
</div>
""", unsafe_allow_html=True)
# Social Links
st.markdown("""
<div class="social-icons">
<a href="https://www.linkedin.com/in/yash-harish-gupta-71b011189/" target="_blank">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png" alt="LinkedIn">
</a>
<a href="https://github.com/YashGupta018" target="_blank">
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub">
</a>
</div>
""", unsafe_allow_html=True)
# Footer
st.markdown("""
<footer>
<p>Made with ❤️ by <strong>Yash Harish Gupta</strong> | © 2024</p>
</footer>
""", unsafe_allow_html=True)
# -------------------------------------------------------------------------------------------------------------------------------------
# import streamlit as st
# from streamlit_lottie import st_lottie
# import requests
# # Function to load Lottie animation from a URL
# def load_lottieurl(url: str):
# """Fetch Lottie animation JSON from a URL."""
# try:
# response = requests.get(url)
# if response.status_code == 200:
# return response.json()
# except requests.exceptions.RequestException:
# return None
# # CSS Styling for light and dark modes with adaptive theme support
# st.markdown("""
# <style>
# :root {
# --background-color: #f8f9fa;
# --text-color: #212529;
# --primary-color: #007acc;
# --secondary-color: #005b96;
# --card-bg: #ffffff;
# --text-muted: #6c757d;
# }
# @media (prefers-color-scheme: dark) {
# :root {
# --background-color: #0e1117;
# --text-color: #e5e5e5;
# --primary-color: #29b6f6;
# --secondary-color: #90caf9;
# --card-bg: #1f2937;
# --text-muted: #a3a3a3;
# }
# }
# body {
# margin: 0;
# padding: 0;
# font-family: 'Roboto', sans-serif;
# background-color: var(--background-color) !important;
# color: var(--text-color) !important;
# }
# h1 {
# font-size: 3rem;
# color: var(--primary-color) !important;
# text-align: center;
# margin-bottom: 15px;
# }
# h2, h3 {
# font-size: 1.5rem;
# color: var(--secondary-color) !important;
# text-align: center;
# margin-top: 20px;
# }
# p {
# font-family: 'Georgia', serif;
# color: var(--text-color) !important;
# line-height: 1.6;
# text-align: justify;
# }
# .about-author {
# background-color: var(--card-bg) !important;
# border-radius: 10px;
# padding: 25px;
# box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
# margin: 20px auto;
# max-width: 700px;
# text-align: center;
# color: var(--text-color) !important;
# }
# .social-icons {
# display: flex;
# justify-content: center;
# gap: 20px;
# margin-top: 15px;
# }
# .social-icons a img {
# width: 40px;
# height: 40px;
# transition: transform 0.3s ease-in-out;
# }
# .social-icons a img:hover {
# transform: scale(1.2);
# }
# footer {
# margin-top: 50px;
# text-align: center;
# font-family: 'Georgia', serif;
# color: var(--text-muted) !important;
# }
# /* Sidebar adjustments */
# .css-1d391kg, .css-1d391kg * {
# background-color: var(--card-bg) !important;
# color: var(--text-color) !important;
# }
# </style>
# """, unsafe_allow_html=True)
# # Sidebar Navigation
# chapters = [
# "Foundation",
# "ML Project Lifecycle",
# "Core Algorithms",
# "Model Evaluation",
# "Data Handling",
# "Computer Vision Basics",
# "Natural Language Processing (NLP)",
# "Deployment & Tools"
# ]
# selected_chapter = st.sidebar.radio("Select Chapter", chapters)
# # Nested page selection based on chapter
# if selected_chapter == "Foundation":
# foundation_main = st.sidebar.radio("Select Page", [
# "Home",
# "Introduction to Data Science",
# "Machine Learning vs Deep Learning"
# ])
# if foundation_main == "Introduction to Data Science":
# selected_subtopic = st.sidebar.radio("Explore More", [
# "Understanding Intelligence",
# "AI Tools: ML, DL, and Gen‑AI",
# "Real‑Life Analogies and Examples",
# "What is Data Science?",
# "The Role of a Data Scientist",
# "Why AI and Data Science Matter",
# "Did You Know?"
# ])
# elif foundation_main == "Machine Learning vs Deep Learning":
# st.sidebar.radio("Explore Comparison", [
# "Understanding Machine Learning and Deep Learning",
# "Comparison Table for ML vs DL"
# ])
# elif selected_chapter == "ML Project Lifecycle":
# stage = st.sidebar.radio("Select Stage", ["Life Cycle of ML Project"])
# if stage:
# st.sidebar.radio("Subtopic", [
# "Problem Statement",
# "Data Collection",
# "Data Preprocessing",
# "Exploratory Data Analysis (EDA)",
# "Feature Engineering",
# "Model Selection",
# "Model Training",
# "Model Evaluation & Tuning",
# "Model Deployment",
# "Monitoring"
# ])
# elif selected_chapter == "Core Algorithms":
# st.sidebar.radio("Select Algorithm", [
# "Linear Regression",
# "Logistic Regression",
# "k‑Nearest Neighbors (kNN)",
# "Decision Trees",
# "Support Vector Machines (SVM)",
# "Ensemble Techniques"
# ])
# elif selected_chapter == "Model Evaluation":
# metric_main = st.sidebar.radio("Select Topic", ["Performance Metrics"])
# if metric_main:
# st.sidebar.radio("Choose Metric", [
# "Accuracy, Precision, Recall",
# "Confusion Matrix",
# "ROC‑AUC"
# ])
# elif selected_chapter == "Data Handling":
# data_main = st.sidebar.radio("Select Topic", [
# "Data Types Overview",
# "Data Cleaning",
# "Feature Engineering"
# ])
# if data_main == "Data Types Overview":
# st.sidebar.radio("Choose Type", [
# "Structured Data (SQL, Excel)",
# "Semi‑Structured Data (JSON, XML)",
# "Unstructured Data (Images, Text)"
# ])
# elif selected_chapter == "Computer Vision Basics":
# cv_topic = st.sidebar.radio("Select Topic", ["Image Processing", "OpenCV Basics"])
# if cv_topic == "Image Processing":
# st.sidebar.radio("Subtopic", [
# "Color Spaces",
# "Image Augmentation",
# "Splitting/Merging Images"
# ])
# elif selected_chapter == "Natural Language Processing (NLP)":
# st.sidebar.radio("Select Topic", ["NLP Introduction", "Text Preprocessing"])
# elif selected_chapter == "Deployment & Tools":
# st.sidebar.radio("Select Tool", [
# "Model Deployment",
# "Working with Excel/CSV",
# "SQL for Data Science"
# ])
# # ======== NEW CONTENT RENDERING ========
# content_rendered = False
# if selected_chapter == "Foundation" and foundation_main == "Introduction to Data Science":
# content_rendered = True
# # Load animations
# brain_animation = load_lottieurl("https://lottie.host/8d7bdc88-7e11-44b5-995a-6561230e54a1/4X3p3YVQZ5.json")
# ml_animation = load_lottieurl("https://lottie.host/5b6292ff-aad4-4a34-8c0a-4c4cd186f80e/5ZVgB9Q9kF.json")
# art_animation = load_lottieurl("https://lottie.host/0d0cf470-8cef-4a0a-8980-3f2d5e573e98/5XvjOZPmhG.json")
# if selected_subtopic == "Understanding Intelligence":
# st.header("🧠 Understanding Intelligence")
# if brain_animation:
# st_lottie(brain_animation, height=200, key="brain")
# col1, col2 = st.columns(2)
# with col1:
# st.markdown("""
# ### Natural Intelligence 🐾
# **Definition:** Innate intelligence in living beings
# - Dogs learning tricks
# - Humans solving puzzles
# - Birds building nests instinctively
# """)
# with col2:
# st.markdown("""
# ### Artificial Intelligence 🤖
# **Definition:** Human-like intelligence in machines
# - Netflix recommendations
# - Google Maps routing
# - Alexa voice assistant
# """)
# elif selected_subtopic == "AI Tools: ML, DL, and Gen‑AI":
# st.header("🔧 AI Toolkit Breakdown")
# if ml_animation:
# st_lottie(ml_animation, height=250, key="ml")
# tabs = st.tabs(["Machine Learning", "Deep Learning", "Generative AI"])
# with tabs[0]:
# st.markdown("""
# **Machine Learning (ML)**
# 🎯 **Purpose:** Pattern recognition & decision making
# 👶 **Analogy:** Teaching toddler to recognize fruits
# 🚀 **Applications:**
# - Spam email filtering
# - Stock price prediction
# - Customer churn analysis
# """)
# with tabs[1]:
# st.markdown("""
# **Deep Learning (DL)**
# 🎯 **Purpose:** Complex data processing
# 🧠 **Structure:** Neural networks with multiple layers
# 🚀 **Applications:**
# - Facial recognition systems
# - Medical image analysis
# - Voice-controlled assistants
# """)
# with tabs[2]:
# st.markdown("""
# **Generative AI**
# 🎯 **Purpose:** Creative content generation
# 🎨 **Analogy:** Digital artist with infinite ideas
# 🚀 **Applications:**
# - ChatGPT conversations
# - DALL·E image creation
# - AI-composed music
# """)
# elif selected_subtopic == "Real‑Life Analogies and Examples":
# col1, col2 = st.columns([2, 1])
# with col1:
# st.header("🎨 Learning vs Generating")
# st.markdown("""
# **Art Analogy:**
# - ML = Sketching with pencil (foundations)
# - DL = Inking with pen (details)
# - Gen-AI = Color painting (creation)
# **Child Development Analogy:**
# 1. Learn alphabet → ML (pattern recognition)
# 2. Write essays → DL (complex processing)
# 3. Create poetry → Gen-AI (original content)
# """)
# with col2:
# if art_animation:
# st_lottie(art_animation, height=300, key="art")
# elif selected_subtopic == "What is Data Science?":
# st.header("🔍 Data Science Demystified")
# st.image("https://miro.medium.com/v2/resize:fit:1400/1*K7nYl2D2QO5B9v6U-4yQxA.png",
# width=600, caption="Data Science Process Flow")
# st.markdown("""
# **Three Pillars of Data Science:**
# 1. 📥 Data Collection:
# - Databases, APIs, IoT sensors
# - Structured & unstructured data
# 2. 🧠 Data Analysis:
# - Statistical modeling
# - Pattern identification
# 3. 📊 Data Visualization:
# - Interactive dashboards
# - Business intelligence tools
# """)
# elif selected_subtopic == "The Role of a Data Scientist":
# st.header("👨💻 Data Scientist's Toolkit")
# st.markdown("""
# **Core Responsibilities:**
# - Build predictive models for business outcomes
# - Analyze customer behavior patterns
# - Optimize operational efficiency
# **Essential Skills Matrix:**
# | Technical Skills | Business Skills |
# |------------------|------------------|
# | Python/R | Domain Knowledge |
# | SQL | Storytelling |
# | ML Frameworks | Problem Solving |
# """)
# elif selected_subtopic == "Why AI and Data Science Matter":
# st.header("🌍 Transformative Impact")
# st.markdown("""
# **Industry Revolution:**
# - Healthcare: Early disease detection (40% faster diagnosis)
# - Agriculture: AI-powered yield prediction (+25% productivity)
# - Entertainment: Personalized content recommendations
# **Economic Impact:**
# > "By 2030, AI could contribute up to $15.7 trillion to global economy"
# -*PwC Global AI Study*
# """)
# elif selected_subtopic == "Did You Know?":
# st.header("🤖 AI in Action: Surprising Uses")
# cols = st.columns(3)
# cols[0].markdown("""
# **Medical Imaging**
# - 92% accuracy in tumor detection
# - Reduces diagnosis time by 60%
# """)
# cols[1].markdown("""
# **Smart Farming**
# - Automated irrigation systems
# - Pest prediction algorithms
# """)
# cols[2].markdown("""
# **Creative AI**
# - AI-written novels
# - Algorithmic music composition
# """)
# st.video("https://www.youtube.com/watch?v=JMUxmLyrhSk")
# # ======== ORIGINAL PAGE ELEMENTS ========
# if not content_rendered:
# # Title and Tagline
# st.title("Mastering Machine Learning: From Basics To Brilliance 🚀🤖")
# st.markdown("## Your Gateway To Become Master In Data Science")
# # Display Lottie animation
# animation_url = "https://lottie.host/a45f4739-ef78-4193-b3f9-2ea435a190d5/PsTVRgXekn.json"
# lottie_animation = load_lottieurl(animation_url)
# if lottie_animation:
# st_lottie(lottie_animation, height=200, key="animation")
# # About the App Section
# st.subheader("About This Application")
# st.markdown("""
# This platform serves as a **comprehensive guide to Machine Learning and Data Science**.
# From grasping the fundamentals to deploying models, it offers insights into the entire lifecycle:
# - **Problem Definition**: Understand the business context and set clear objectives.
# - **Data Handling**: Collect, clean, and explore datasets to uncover insights.
# - **Model Development**: Build and optimize machine learning models.
# - **Model Deployment**: Deliver real-world solutions and monitor performance.
# Designed for both beginners and those looking to refine their skills, this app provides a structured learning path enriched with practical examples.
# """)
# # Key Takeaways Section
# st.subheader("What You'll Learn Here")
# st.markdown("""
# 1. **Step-by-Step Roadmaps**: Detailed guidance to help you navigate through data science challenges.
# 2. **Hands-on Projects**: Real-world examples and code snippets for applied learning.
# 3. **Visualizations**: Clear, intuitive graphs and plots to simplify complex concepts.
# 4. **Insights from Experience**: Lessons from my personal journey to help you avoid common pitfalls.
# """)
# # Author Section (Always visible)
# st.markdown("""
# <div class="about-author">
# <h2>About the Author</h2>
# <p>
# Hello! I'm <strong>Yash Harish Gupta</strong>, an aspiring data scientist deeply passionate about machine learning.
# My journey began with curiosity about how data drives decisions and has evolved into a mission to create impactful solutions.
# Currently, I am learning and preparing to embark on my professional career in this exciting field.
# </p>
# </div>
# """, unsafe_allow_html=True)
# # Social Links Section
# st.markdown("""
# <div class="social-icons">
# <a href="https://www.linkedin.com/in/yash-harish-gupta-71b011189/" target="_blank">
# <img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png" alt="LinkedIn">
# </a>
# <a href="https://github.com/YashGupta018" target="_blank">
# <img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub">
# </a>
# </div>
# """, unsafe_allow_html=True)
# # Footer Section
# st.markdown("""
# <footer>
# <p>Made with ❤️ by <strong>Yash Harish Gupta</strong> | © 2024</p>
# </footer>
# """, unsafe_allow_html=True)
# -----------------------------------------------------------------------------------------------------------------------------------------------------------
# import streamlit as st
# from streamlit_lottie import st_lottie
# import requests
# # Function to load Lottie animation from a URL
# def load_lottieurl(url: str):
# """Fetch Lottie animation JSON from a URL."""
# try:
# response = requests.get(url)
# if response.status_code == 200:
# return response.json()
# except requests.exceptions.RequestException:
# return None
# # CSS Styling for light and dark modes with adaptive theme support
# st.markdown("""
# <style>
# :root {
# --background-color: #f8f9fa;
# --text-color: #212529;
# --primary-color: #007acc;
# --secondary-color: #005b96;
# --card-bg: #ffffff;
# --text-muted: #6c757d;
# }
# @media (prefers-color-scheme: dark) {
# :root {
# --background-color: #0e1117;
# --text-color: #e5e5e5;
# --primary-color: #29b6f6;
# --secondary-color: #90caf9;
# --card-bg: #1f2937;
# --text-muted: #a3a3a3;
# }
# }
# body {
# margin: 0;
# padding: 0;
# font-family: 'Roboto', sans-serif;
# background-color: var(--background-color) !important;
# color: var(--text-color) !important;
# }
# h1 {
# font-size: 3rem;
# color: var(--primary-color) !important;
# text-align: center;
# margin-bottom: 15px;
# }
# h2, h3 {
# font-size: 1.5rem;
# color: var(--secondary-color) !important;
# text-align: center;
# margin-top: 20px;
# }
# p {
# font-family: 'Georgia', serif;
# color: var(--text-color) !important;
# line-height: 1.6;
# text-align: justify;
# }
# .about-author {
# background-color: var(--card-bg) !important;
# border-radius: 10px;
# padding: 25px;
# box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
# margin: 20px auto;
# max-width: 700px;
# text-align: center;
# color: var(--text-color) !important;
# }
# .social-icons {
# display: flex;
# justify-content: center;
# gap: 20px;
# margin-top: 15px;
# }
# .social-icons a img {
# width: 40px;
# height: 40px;
# transition: transform 0.3s ease-in-out;
# }
# .social-icons a img:hover {
# transform: scale(1.2);
# }
# footer {
# margin-top: 50px;
# text-align: center;
# font-family: 'Georgia', serif;
# color: var(--text-muted) !important;
# }
# /* Sidebar adjustments */
# .css-1d391kg, .css-1d391kg * {
# background-color: var(--card-bg) !important;
# color: var(--text-color) !important;
# }
# </style>
# """, unsafe_allow_html=True)
# # Sidebar Navigation
# chapters = [
# "Foundation",
# "ML Project Lifecycle",
# "Core Algorithms",
# "Model Evaluation",
# "Data Handling",
# "Computer Vision Basics",
# "Natural Language Processing (NLP)",
# "Deployment & Tools"
# ]
# selected_chapter = st.sidebar.radio("Select Chapter", chapters)
# # Nested page selection based on chapter
# if selected_chapter == "Foundation":
# foundation_main = st.sidebar.radio("Select Page", [
# "Home",
# "Introduction to Data Science",
# "Machine Learning vs Deep Learning"
# ])
# if foundation_main == "Introduction to Data Science":
# st.sidebar.radio("Explore More", [
# "Understanding Intelligence",
# "AI Tools: ML, DL, and Gen‑AI",
# "Real‑Life Analogies and Examples",
# "What is Data Science?",
# "The Role of a Data Scientist",
# "Why AI and Data Science Matter",
# "Did You Know?"
# ])
# elif foundation_main == "Machine Learning vs Deep Learning":
# st.sidebar.radio("Explore Comparison", [
# "Understanding Machine Learning and Deep Learning",
# "Comparison Table for ML vs DL"
# ])
# elif selected_chapter == "ML Project Lifecycle":
# stage = st.sidebar.radio("Select Stage", ["Life Cycle of ML Project"])
# if stage:
# st.sidebar.radio("Subtopic", [
# "Problem Statement",
# "Data Collection",
# "Data Preprocessing",
# "Exploratory Data Analysis (EDA)",
# "Feature Engineering",
# "Model Selection",
# "Model Training",
# "Model Evaluation & Tuning",
# "Model Deployment",
# "Monitoring"
# ])
# elif selected_chapter == "Core Algorithms":
# st.sidebar.radio("Select Algorithm", [
# "Linear Regression",
# "Logistic Regression",
# "k‑Nearest Neighbors (kNN)",
# "Decision Trees",
# "Support Vector Machines (SVM)",
# "Ensemble Techniques"
# ])
# elif selected_chapter == "Model Evaluation":
# metric_main = st.sidebar.radio("Select Topic", ["Performance Metrics"])
# if metric_main:
# st.sidebar.radio("Choose Metric", [
# "Accuracy, Precision, Recall",
# "Confusion Matrix",
# "ROC‑AUC"
# ])
# elif selected_chapter == "Data Handling":
# data_main = st.sidebar.radio("Select Topic", [
# "Data Types Overview",
# "Data Cleaning",
# "Feature Engineering"
# ])
# if data_main == "Data Types Overview":
# st.sidebar.radio("Choose Type", [
# "Structured Data (SQL, Excel)",
# "Semi‑Structured Data (JSON, XML)",
# "Unstructured Data (Images, Text)"
# ])
# elif selected_chapter == "Computer Vision Basics":
# cv_topic = st.sidebar.radio("Select Topic", ["Image Processing", "OpenCV Basics"])
# if cv_topic == "Image Processing":
# st.sidebar.radio("Subtopic", [
# "Color Spaces",
# "Image Augmentation",
# "Splitting/Merging Images"
# ])
# elif selected_chapter == "Natural Language Processing (NLP)":
# st.sidebar.radio("Select Topic", ["NLP Introduction", "Text Preprocessing"])
# elif selected_chapter == "Deployment & Tools":
# st.sidebar.radio("Select Tool", [
# "Model Deployment",
# "Working with Excel/CSV",
# "SQL for Data Science"
# ])
# # Title and Tagline
# st.title("Mastering Machine Learning: From Basics To Brilliance 🚀🤖")
# st.markdown("## Your Gateway To Become Master In Data Science")
# # Display Lottie animation
# animation_url = "https://lottie.host/a45f4739-ef78-4193-b3f9-2ea435a190d5/PsTVRgXekn.json"
# lottie_animation = load_lottieurl(animation_url)
# if lottie_animation:
# st_lottie(lottie_animation, height=200, key="animation")
# # About the App Section
# st.subheader("About This Application")
# st.markdown("""
# This platform serves as a **comprehensive guide to Machine Learning and Data Science**.
# From grasping the fundamentals to deploying models, it offers insights into the entire lifecycle:
# - **Problem Definition**: Understand the business context and set clear objectives.
# - **Data Handling**: Collect, clean, and explore datasets to uncover insights.
# - **Model Development**: Build and optimize machine learning models.
# - **Model Deployment**: Deliver real-world solutions and monitor performance.
# Designed for both beginners and those looking to refine their skills, this app provides a structured learning path enriched with practical examples.
# """)
# # Key Takeaways Section
# st.subheader("What You'll Learn Here")
# st.markdown("""
# 1. **Step-by-Step Roadmaps**: Detailed guidance to help you navigate through data science challenges.
# 2. **Hands-on Projects**: Real-world examples and code snippets for applied learning.
# 3. **Visualizations**: Clear, intuitive graphs and plots to simplify complex concepts.
# 4. **Insights from Experience**: Lessons from my personal journey to help you avoid common pitfalls.
# """)
# # Author Section
# st.markdown("""
# <div class="about-author">
# <h2>About the Author</h2>
# <p>
# Hello! I'm <strong>Yash Harish Gupta</strong>, an aspiring data scientist deeply passionate about machine learning.
# My journey began with curiosity about how data drives decisions and has evolved into a mission to create impactful solutions.
# Currently, I am learning and preparing to embark on my professional career in this exciting field.
# </p>
# </div>
# """, unsafe_allow_html=True)
# # Social Links Section
# st.markdown("""
# <div class="social-icons">
# <a href="https://www.linkedin.com/in/yash-harish-gupta-71b011189/" target="_blank">
# <img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png" alt="LinkedIn">
# </a>
# <a href="https://github.com/YashGupta018" target="_blank">
# <img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub">
# </a>
# </div>
# """, unsafe_allow_html=True)
# # Footer Section
# st.markdown("""
# <footer>
# <p>Made with ❤️ by <strong>Yash Harish Gupta</strong> | © 2024</p>
# </footer>
# """, unsafe_allow_html=True)
# -------------------------------------------------------------------------------------------------------------------------------------------------------
# import streamlit as st
# from streamlit_lottie import st_lottie
# import requests
# # Function to load Lottie animation from a URL
# def load_lottieurl(url: str):
# """Fetch Lottie animation JSON from a URL."""
# try:
# response = requests.get(url)
# if response.status_code == 200:
# return response.json()
# except requests.exceptions.RequestException:
# return None
# # CSS Styling for light and dark modes
# st.markdown("""
# <style>
# body {
# margin: 0;
# padding: 0;
# font-family: 'Roboto', sans-serif;
# background-color: var(--background-color, #f8f9fa);
# color: var(--text-color, #212529);
# }
# h1 {
# font-size: 3rem;
# color: var(--primary-color, #007acc);
# text-align: center;
# margin-bottom: 15px;
# }
# h2, h3 {
# font-size: 1.5rem;
# color: var(--secondary-color, #005b96);
# text-align: center;
# margin-top: 20px;
# }
# p {
# font-family: 'Georgia', serif;
# color: var(--text-color, #212529);
# line-height: 1.6;
# text-align: justify;
# }
# .about-author {
# background-color: var(--card-bg, #ffffff);
# border-radius: 10px;
# padding: 25px;
# box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
# margin: 20px auto;
# max-width: 700px;
# text-align: center;
# color: var(--text-color, #212529);
# }
# .social-icons {
# display: flex;
# justify-content: center;
# gap: 20px;
# margin-top: 15px;
# }
# .social-icons a img {
# width: 40px;
# height: 40px;
# transition: transform 0.3s ease-in-out;
# }
# .social-icons a img:hover {
# transform: scale(1.2);
# }
# footer {
# margin-top: 50px;
# text-align: center;
# font-family: 'Georgia', serif;
# color: var(--text-muted, #6c757d);
# }
# </style>
# """, unsafe_allow_html=True)
# # Title and Tagline
# st.title("Mastering Machine Learning: From Basics To Brilliance 🚀🤖")
# st.markdown("## Your Gateway To Become Master In Data Science")
# # Display Lottie animation
# animation_url = "https://lottie.host/a45f4739-ef78-4193-b3f9-2ea435a190d5/PsTVRgXekn.json"
# lottie_animation = load_lottieurl(animation_url)
# if lottie_animation:
# st_lottie(lottie_animation, height=200, key="animation")
# # About the App Section
# st.subheader("About This Application")
# st.markdown("""
# This platform serves as a **comprehensive guide to Machine Learning and Data Science**.
# From grasping the fundamentals to deploying models, it offers insights into the entire lifecycle:
# - **Problem Definition**: Understand the business context and set clear objectives.
# - **Data Handling**: Collect, clean, and explore datasets to uncover insights.
# - **Model Development**: Build and optimize machine learning models.
# - **Model Deployment**: Deliver real-world solutions and monitor performance.
# Designed for both beginners and those looking to refine their skills, this app provides a structured learning path enriched with practical examples.
# """)
# # Key Takeaways Section
# st.subheader("What You'll Learn Here")
# st.markdown("""
# 1. **Step-by-Step Roadmaps**: Detailed guidance to help you navigate through data science challenges.
# 2. **Hands-on Projects**: Real-world examples and code snippets for applied learning.
# 3. **Visualizations**: Clear, intuitive graphs and plots to simplify complex concepts.
# 4. **Insights from Experience**: Lessons from my personal journey to help you avoid common pitfalls.
# """)
# # Author Section
# st.markdown("""
# <div class="about-author">
# <h2>About the Author</h2>
# <p>
# Hello! I'm <strong>Yash Harish Gupta</strong>, an aspiring data scientist deeply passionate about machine learning.
# My journey began with curiosity about how data drives decisions and has evolved into a mission to create impactful solutions.
# Currently, I am learning and preparing to embark on my professional career in this exciting field.
# </p>
# </div>
# """, unsafe_allow_html=True)
# # Social Links Section
# st.markdown("""
# <div class="social-icons">
# <a href="https://www.linkedin.com/in/yash-harish-gupta-71b011189/" target="_blank">
# <img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png" alt="LinkedIn">
# </a>
# <a href="https://github.com/YashGupta018" target="_blank">
# <img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub">
# </a>
# </div>
# """, unsafe_allow_html=True)
# # Footer Section
# st.markdown("""
# <footer>
# <p>Made with ❤️ by <strong>Yash Harish Gupta</strong> | © 2024</p>
# </footer>
# """, unsafe_allow_html=True)