Skip to main content

Command Palette

Search for a command to run...

📘 Day 2: Set Theory & Notation Refresher – The Language of Math in ML

Published
2 min readView as Markdown
O

Hello there! I'm a passionate tech enthusiast with a diverse range of interests, including quantum computing, web development, ReactJS, Python, data science, JS, and machine learning. As a seasoned writer and developer, I enjoy sharing my knowledge and experiences with others through engaging and informative articles. Whether you're looking to explore the cutting-edge world of quantum computing or want to learn how to build robust web applications using the latest technologies, I've got you covered. Join me on this exciting journey of discovery, and let's learn together!

🎯 Why This Topic Matters

Before we get into algorithms and models, it’s crucial to understand the basic notations used in machine learning papers, textbooks, and code. Most of these come from Set Theory — the foundation of data, probability, and logic in ML.

This post gives you a simple, intuitive refresher on the symbols and concepts you’ll encounter again and again.

📚 What is a Set?

A set is a well-defined collection of distinct objects.

Example:
Let X={1,2,3,4}
This is a set of numbers.

In ML:

  • The set of inputs (features) is often denoted by X

  • The set of labels or outputs is denoted by Y

✍️ Basic Notation You’ll See Often

SymbolMeaningExample
"is an element of"2∈X
"is not an element of"5∉X
SubsetA⊆B
UnionA∪B
IntersectionA∩B
\Set differenceA\B
Empty setNo elements

🧠 Practical ML Contexts

1. Feature Space and Sample Space

  • Input features: X={x1,x2,…,xn}

  • Labels: Y={0,1}

A training dataset is just a set of pairs:
D={(xi,yi) ∣ i=1…n}

2. Probability Events

In probability, an event is a subset of all possible outcomes.

  • A⊆Ω, where Ω is the sample space.

Example:
If Ω={Heads,Tails}, then

  • Event A={Heads}

  • P(A)=0.5

📏 Functions as Sets of Pairs

A function f: X→Y is a rule that maps each element in X to exactly one in Y.

In ML, models are just functions!
E.g., Linear regression: f(x)=wx+b

So understanding functions as mappings helps.

🧠 Pro Tip:

ML algorithms often operate on vectors or matrices of data, but at their core, these are just organized sets of elements.


Key Takeaways

  • Set theory is the grammar of mathematical language.

  • It helps define data, probabilities, features, labels, and events.

  • ML models are mappings (functions) between sets.

Math Behind Machine Learning: 60 Days of Insight

Part 2 of 4

Explore the importance of mathematics in machine learning. This blog series covers essential concepts like linear algebra, calculus, probability, and optimization. Perfect for beginners or those refreshing their knowledge to master AI algorithms.

Up next

📦 Day 3: Vectors and Scalars – The DNA of Machine Learning Data

🎯 Why You Need to Understand This At the heart of every machine learning model lies a simple truth: all your input data — images, text, audio, or numbers — is ultimately converted into vectors. Whether it’s a pixel intensity, a word embedding, or a...

More from this blog

Om Koli: Insights, Tutorials, and News on Quantum Computing, JavaScript, ReactJS, Data Science, and Python.

10 posts

Hello there! I'm a passionate tech enthusiast with a diverse range of interests, including quantum computing, web development, ReactJS, Python, data science, JS, and machine learning.