Skip to content

⚙️ Machine Learning

Machine Learning is the science of building systems that learn from data. We use Scikit-Learn — the most popular ML library in Python.


📋 What You'll Learn

Notebook Topics Covered Difficulty
Types of Machine Learning Supervised, Unsupervised, Semi-Supervised & Reinforcement Learning overview 🟡 Intermediate
Batch vs Online Learning Difference between batch learning and online learning with practical examples 🟢 Beginner
Instance-Based vs Model-Based Learning Understand instance-based and model-based learning with comparisons 🟡 Intermediate
Challenges in Machine Learning Learn about overfitting, underfitting, data quality, bias, and scalability challenges 🟡 Intermediate
Applications of Machine Learning Explore real-world applications of Machine Learning across various domains 🟢 Beginner
Machine Learning Development Lifecycle Complete ML pipeline from problem definition to deployment and monitoring 🟡 Intermediate
What Is Tensors Introduction to tensors, dimensions, shapes, and tensor operations in Deep Learning 🟡 Intermediate
How to Frame a Machine Learning Problem Learn how to formulate ML problems, define targets, and choose evaluation metrics 🟡 Intermediate

🔑 Key Concepts

  • Supervised Learning: Regression & Classification
  • Unsupervised Learning: Clustering & Dimensionality Reduction
  • Bias-Variance Tradeoff: Underfitting vs Overfitting
  • Cross-Validation: K-Fold, Stratified K-Fold
  • Metrics: MSE, RMSE, R², Accuracy, Precision, Recall, F1, AUC-ROC
  • Pipelines: Chaining preprocessing + model into one object
  • Hyperparameter Tuning: GridSearchCV, RandomizedSearchCV

🚀 Quick Example

from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
from sklearn.datasets import load_iris

# Load data
X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Build pipeline
pipeline = Pipeline([
    ('scaler', StandardScaler()),
    ('clf',    RandomForestClassifier(n_estimators=100, random_state=42))
])

# Train & evaluate
pipeline.fit(X_train, y_train)
scores = cross_val_score(pipeline, X, y, cv=5)
print(f"CV Accuracy: {scores.mean():.3f} ± {scores.std():.3f}")

The ML Workflow

  1. Define the problem (regression vs classification)
  2. Collect & clean data
  3. Explore with EDA
  4. Preprocess (scale, encode, impute)
  5. Train multiple models
  6. Evaluate with proper metrics
  7. Tune hyperparameters
  8. Deploy the final model

Continue to Deep Learning →