MachineLearning / pages /2Machine Learning vs Deep Learning.py
LakshmiHarika's picture
Update pages/2Machine Learning vs Deep Learning.py
e5164c7 verified
import streamlit as st
import pandas as pd
st.set_page_config(
page_title="HomePage",
page_icon="🚀",
layout="wide"
)
st.write("""
As we discussed earlier, to mimic the learning ability of natural intelligence, we rely on two powerful tools:
- **Machine Learning (ML)**
- **Deep Learning (DL)**
""")
st.write("""
These tools share the same purpose: enabling machines to learn. However, just like two students in the same class who use different tools for the same task, these tools have their unique characteristics.
""")
st.write("""
### ✨ Imagine This: ✏️📚
Two students are in the same class. One student takes notes every day. The second student, who hasn’t been consistent with their notes, borrows the first student’s notes to copy them. To do this, they use two tools: a pen and a pencil. While both tools serve the same purpose of writing, their functionality differs:
""")
st.write("""
- A **pencil** is used for temporary writing, as it can be erased and modified.
- A **pen** is used for permanent writing, as it creates indelible marks.
""")
st.write("""
Similarly, **Machine Learning (ML)** and **Deep Learning (DL)** share the same goal: **Learning**. However, their approaches and functionalities differ, much like the pen and pencil.
Let’s now dive deeper to explore these differences and understand how each tool works.
""")
st.markdown("""
<h3 style="color: #9400d3;">🧠 Key Differences Between Machine Learning (ML) and Deep Learning (DL)</h3>
""", unsafe_allow_html=True)
st.write("""
One key difference lies in how **Machine Learning (ML)** and **Deep Learning (DL)** handle data:
- **Machine Learning (ML)**: Works effectively with small datasets, making it suitable for scenarios where data is limited.
- **Deep Learning (DL)**: Requires large amounts of data to achieve high accuracy and performance(Hungry of Data).
The graph below illustrates this difference, showing how performance improves with increasing data for both ML and DL.
""")
# Add the graph image
st.image("https://huggingface.co/spaces/LakshmiHarika/MachineLearning/resolve/main/Images/ML%20Vs%20DL.png", caption="Performance vs Data for ML and DL", use_container_width=True)
data = {
"Feature": ["Definiton","Learning Ability","Data Type","Memory Usage","Training Time","Hardware Requirement"],
"Machine Learning (ML)": [
"Machine Learning (ML) is a tool that enables machines to mimic natural intelligence by providing them with the ability to learn, ultimately creating artificial intelligence.",
"Uses statistical concepts to mimic the learning ability",
"Only works on structured data. It can handle unstructured and semi-structured data, but it must first be converted into structured data, often leading to loss of information.",
"Uses a small amount of memory, making it lightweight",
"Takes less time to train models",
"Can run on CPUs with lower storage needs."],
"Deep Learning (DL)": [
"Deep Learning (DL) is a specialized subset of Machine Learning that uses artificial neural networks to mimic natural intelligence by providing them with the ability to learn, ultimately creating artificial intelligence.",
'Utilizes logical structures, such as <a href="https://www.google.com/search?q=what+is+neurons" target="_blank">neurons</a>, to mimic the learning ability',
"Works seamlessly with both structured and unstructured data",
"Requires significantly more memory due to its complex architectures",
"Requires much more time to train due to its complex computations",
"Runs better on GPUs with more storage and computational power."]
}
table_style = """
<style>
table {
width: 100%;
border-collapse: collapse;
text-align: left;
}
th {
padding: 10px;
border: 1px solid #dddddd;
background-color: ffc87c; /* Dark blue background */
color: #000000; /* White text */
text-align: center; /* Center align column names */
}
td:nth-child(1) {
font-weight: bold; /* Bold text */
}
td {
padding: 10px;
border: 1px solid #dddddd;
vertical-align: top;
}
td:nth-child(2), td:nth-child(3) {
width: 40%; /* Equal column width */
}
</style>
"""
df = pd.DataFrame(data)
st.markdown(table_style, unsafe_allow_html=True) # Apply the styling
st.markdown(
df.to_html(escape=False, index=False),
unsafe_allow_html=True
)
st.write("**Conclusion**: Both Machine Learning and Deep Learning play vital roles in mimicking natural intelligence. "
"By understanding their differences, we can better utilize these tools to create innovative and intelligent systems.")