Skip to main content

Day 11 – Data Preprocessing with Scikit-Learn

Published 2 min readMarkdown

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 SimpleImputer to 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_split to 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. πŸ˜€πŸ‘Š

No comments yet. Be the first to comment.

More from this blog