Day 11 β Data Preprocessing with Scikit-Learn
Hey everyone π Dhairya here,
Today, I moved from pure math and probability into practical machine learning work using Scikit-Learn. Before training any model, the data needs to be cleaned, transformed, and preprocessed β and thatβs what I focused on today.
π’ What I Learned Today
1. Handling Missing Values
Real-world datasets often have missing data.
Scikit-Learn provides
SimpleImputerto replace missing values with mean, median, or a constant.
2. Encoding Categorical Features
Machine learning models only work with numbers.
Label Encoding β converts categories to numbers (e.g.,
Maleβ0,Femaleβ1).One-Hot Encoding β creates separate columns for each category (avoids ordinal relationship issues).
3. Feature Scaling
Features may have very different scales.
Standardization (Z-score) β mean = 0, std dev = 1.
Normalization (Min-Max Scaling) β values scaled between 0 and 1.
4. Train-Test Split
- Dividing data into training and testing sets using
train_test_splitto evaluate model performance fairly.
π± Reflections
Preprocessing felt like cleaning and sharpening tools before building something. Itβs boring but critical β without clean data, even the best models fail.
I now understand why preprocessing pipelines are vital in production ML systems.
π» Notebook
My Day 11 notebook is here π GitHub Link β Day 11 Notebook
π Resources
π₯ YouTube
π Websites
π― Whatβs Next?
For Day 12, Iβll start exploring building my first ML model using Scikit-Learn (Logistic Regression & Decision Trees).
See you tomorrow π
β Dhairya
About the author
I'm a student, trying to find experience and develop skills, and I want to log that journey here. ππ
Comments
Join the discussionNo comments yet. Be the first to comment.