Issue #6 - Beyond Binary Classification
With the bites of SQL's killer commands, Python's powerful methods, and the visual encoding strategies of DataViz...
Hey everyone! This is Josep, one more week 👋🏻
Today we have a new issue plenty of stuff 💥
Multiclass Logistic Regression 🧺
Think of Logistic Regression as the go-to method when your data wants to pick sides, like choosing between cats or dogs.
But what if it's not just a two-team game?
Then we need what we call Multiclass Logistic Regression. There are two main approaches to adjust Logistic Regression to MULTIPLE Logistic Regression:
One-vs-Rest
Even though we know the Logistic Regression model cannot assume more classes, it excels in distinguishing one class from another one.
So… what if we train multiple Logistic Regression classifiers, one for each class?
The idea would be to focus on classifying a single class and considering the rest of the elements as a single other class, and thus, have multiple binary classification problems.
Multinomial Logistic Rregression:
Instead of assuming that we only have two classes (0 or 1), we build a model that outputs a vector of probabilities for each class!
Therefore, the Multinomial Logistic Regression aims to build a model that outputs a vector of probabilities for each class — each probability reflecting how well the input matches the corresponding class.
Each element in f should be a probability for how well input x matches the class.
You can check more about logistic regression in the following article.
Do you prefer getting one of my cheatsheets? Here you have it!
🧩 Weekly Bites
#1.SQL's killer commands-FROM RAW TO CLEAN DATA ⚙️
Imagine you're a data detective and you've just stumbled upon a scene with some missing clues (null values) and you need to piece together the storyline (data trends).
Enter your SQL sidekicks:
COALESCE()
is like a smart buddy that quickly fills in the blanks with zeroes, so there are no gaps in your data story.
LAG()
is the wise old sage that can look back in time (previous rows) and tell you how things changed from one data point to the next.
Armed with these commands, you'll turn a jumbled data plot into a clean, coherent narrative, ready to crack the case wide open! 🕵️♂️📊✨
If you prefer a cheatsheet, just go get it!
#2.Python powerful methods-MAKE SENSE OUT OF DATA📈
Drowning in data and not sure how to deal with it?
ISNULL()
scans through your DataFrame and flags all null values. You get a boolean table whereTrue
yells "Found one!" andFalse
means all clear.It's your first step to a squeaky-clean dataset!
GROUPBY()
groups rows by categories you choose. Then, it lets you apply any data transformation, like summing expenses in each group.It's like having a data party, and only the rows with matching invites can form a team to unlock aggregated secrets.
Data magic unleashed with just two commands and discover patterns and insights in a flash.
If you prefer a cheatsheet, just go get it!
#3. Alchemy of Data Viz - Visual Encodings! 🎨📊
Imagine your data could wear costumes and perform on stage.
That's what visual encodings do!
They dress up dry numbers in snazzy shapes, sizes, and colors to tell a story that our brains can follow without getting lost in translation. It's like turning numbers into a silent movie where each bar, dot, or line is an actor showing off its value.
1. Retinal Encodings: These are the flashy costumes—think size, intensity, and color. They make certain data jump out at you, demanding your attention like a lead actor under a spotlight.
2. Spatial Encodings: This is the stage direction, arranging actors to create a pattern we instinctively understand—who's leading, who's following, who's out of line.
Together, they're a dynamic duo, transforming abstract digits into a visual feast, making our retinas dance and our brains applaud.
And just like that, you're fluent in the language of visuals!
You can check how to implement this in the following article.
Do you prefer getting one of my cheatsheets? Here you have it!
And this is all for now!
If you have any suggestions or preferences, please comment below or message me through my social media!
Remember you can also find me in X, Threads, Medium and LinkedIn 🤓