🌟 Machine Learning Cheat Sheet

 

1️⃣ Types of Machine Learning

Supervised Learning

Meaning: Model learns from labeled data (input + correct answer).

Examples:

  • Predict price (regression)

  • Predict category (classification)

Unsupervised Learning

Meaning: Model learns patterns from unlabeled data (no correct answers).

Examples:

  • Group similar customers (clustering)

  • Reduce dimensions (PCA)

Reinforcement Learning

Meaning: Model learns by trial and error using rewards.

Example:

  • Playing chess

  • Robot navigation

2️⃣ Common ML Algorithms (with definitions)

Linear Regression

Meaning: Predicts a number using a straight-line relationship.

Logistic Regression

Meaning: Predicts categories (yes/no, spam/not spam). Uses a sigmoid (S-shaped curve).

Decision Tree

Meaning: Predicts by learning rules (like a flowchart): “Is salary > 50k? → Yes → Next condition...”

Random Forest

Meaning: Many decision trees vote together → more accurate, less overfitting.

K-Means Clustering

Meaning: Groups data into K clusters by distance. Useful for segmentation.

Neural Networks

Meaning: Layers of “neurons” that transform data. Good for images, audio, NLP.

3️⃣ Key ML Terminology (Most Used Words in Interviews)

Feature

Meaning: Column of data → e.g., age, salary, temperature.

Label / Target

Meaning: The value you want to predict.

Training Data

Meaning: Data the model learns from.

Test Data

Meaning: Unseen data used to check performance.

Validation Data

Meaning: Data used for tuning the model.

Model Parameters

Meaning: Values the model learns (weights in regression/neural nets).

Hyperparameters

Meaning: Settings you choose manually (learning rate, number of trees, etc.)

4️⃣ Evaluation Metrics (With Meaning)

✔️ For Classification

  • Accuracy: % correct predictions

  • Precision: Of predicted positives, how many actually positive

  • Recall: Of actual positives, how many were identified

  • F1 Score: Balance of precision + recall

  • AUC/ROC: Ability to separate classes

✔️ For Regression

  • MSE: Average squared error

  • RMSE: Square root of MSE

  • MAE: Average absolute error

  • R²: How much variance the model explains

5️⃣ Overfitting & Underfitting

Overfitting

Meaning: Model memorizes the training data → poor generalization.

Fix: Simplify model, add regularization, more data.

Underfitting

Meaning: Model too simple → misses patterns.

Fix: More complex model, reduce regularization.

6️⃣ Feature Engineering

Common Steps

  • Handle missing values → fill or drop

  • One-hot encoding → convert categories to numbers

  • Normalization/Standardization → scale values

  • Remove outliers

  • Feature selection → pick important features

7️⃣ Train → Validate → Test Pipeline

Always keep this workflow in mind:

  1. Understand the problem

  2. Gather data

  3. Clean data

  4. Feature engineering

  5. Split into train/validation/test

  6. Train model

  7. Tune hyperparameters

  8. Evaluate metrics

  9. Deploy

  10. Monitor & retrain

If you say this flow confidently, you’ll sound super solid.

8️⃣ Bonus Phrases that Impress Interviewers

  • “I always start with simple interpretable models first.”

  • “Data quality affects model performance more than algorithm choice.”

  • “I use cross‑validation to generalize well.”

  • “Feature engineering can matter more than the model.”

Comments

Popular posts from this blog

AI Magic in Your Hands: A Step-by-Step Guide to Mastering AI Prompts for Every Use Case

AI: Born from Code, Raised by Curiosity – A Beginner’s Dive into Concepts, History & Impact