Issue #7 - Classifying flowers with Logistic Regression
With the bites of SQL's killer commands, Python's powerful methods, and the rules of colors in DataViz
Hey everyone! This is Josep, one more week 👋🏻
Today we have a new issue plenty of stuff 💥
Multiclass Logistic Regression into action! 💣
Imagine you have a bouquet of iris flowers, each distinct in its petal size. 🌸
Now frame the following problem:
Setosa are way more worthy than any of the other flowers, BUT, you have no idea how to distinguish them.
So you are afraid you will be losing money by selling Setosas as if they were Versicolor or Virginica.
To assess this problem, we can apply our freshly learned Multiple Class Logistic Regression algorithm!
To do so, we already know the steps to follows:
Getting the data to feed our model.
Perform some first analysis to understand the structure of our data.
Understanding our data to choose our features (correlations and patterns).
Prepare the dataset to train our Logistic Regression model (encoding the features and splitting our dataset into a training and testing data sets)
Use scikit-learn to develope our model.
Have a final working algorithm (and results)! 🤖
In a few steps, we take the features, apply some logistic magic, and voilà, the system learns to classify the flowers!
So next time you look at a beautiful iris, remember there's a way to use its measurements to find out its type, with a sprinkle of data and a pinch of algorithmic intuition.
Do you prefer getting one of my cheatsheets? Here you have it!
🧩 Weekly Bites
#1.SQL's killer commands-FROM RAW TO CLEAN DATA ⚙️
Welcome to SQL's sorting hat, where data rows queue up to find their rightful rank in the grand school of databases! 🧙♂️✨
Cast the
RANK()
spell to line up your rows like students in a school photo.Got equal values?
They huddle together with the same rank, leaving gaps just like kids sneaking off for mischief.
We get a perfectly ordered picture with space for everyone's unique traits.
Use
ROW_NUMBER()
to hand out unique ID badges, giving each row its moment in the spotlight.Even twins (or duplicate values) get their own number, ensuring every record is as special as any other!
Summon
DENSE_RANK()
to close up those pesky gaps, squeezing rows together in a cozy, continuous rank with no empty seats left in the auditorium.
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? Here there are two killer commands!
.HEAD()
, Python's sneak peek command. It's like opening the lid just a bit to spy on the first few pieces of data in your massive pot of information.Need a quick look at your data's appetizer?
.head()
serves you the top rows on a silver platter!
.INFO()
, the X-ray vision for your dataset's skeleton.It's your data's medical chart, showing what's under the hood—types of data, missing values, and more.
Quick, insightful, and oh-so-telling!
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 - The Rules to use Colors in our Visuals! 🎨📊
Imagine your data is a party and colors are the guests—how you use them can make or break the vibe! 🎨📊
1️⃣ First, pick colors that feel right. Always try to employ colors that your audience naturally associate with your categories, like blue for water and brown for coffee.
It’s like flavoring food, the right match makes the dish delish!
2️⃣ Moderation is your friend.
Don’t invite the whole color wheel, too many hues cause a visual traffic jam.
Instead, spotlight the star data points in bold colors, making them pop like the life of the party!
3️⃣ Keep your color theme consistent!
If blue is for a specific category in one graph, keep it the same across all.
Changing it up is like changing the music mid-song—confusing
Use these color cues, and your data story will be a hit, easy on the eyes and the mind. It's like being the best-dressed: when it's right, it just clicks! 💡👌
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 🤓