Specialisation B: Data Analytics for Economics

Online MA · Sem 4

Lesson 4 of 4Economics

Machine Learning Basics for Economists

Specialisation B: Data Analytics for Economics

About the video

All Machine Learning algorithms explained in 17 min

Infinite Codes

Study notes

Machine learning develops algorithms that learn from data and generalize to unseen data. It splits into supervised learning (regression and classification with labeled data) and unsupervised learning (finding structure such as clusters or lower-dimensional representations without labels). Key algorithms range from linear regression to ensembles and neural networks.

Supervised vs unsupervised

  • Supervised: features (inputs) predict a target with known labels in training data.
  • Regression predicts a continuous target (house price); classification predicts a discrete class (spam/not spam).
  • Unsupervised: no labels; find structure, e.g., clustering emails into unspecified groups.

Core supervised algorithms

  • Linear regression: fits a line minimizing sum of squared errors; basis for many advanced methods.
  • Logistic regression: fits a sigmoid to give class probabilities.
  • KNN: non-parametric; predicts average/majority of K nearest neighbors. Small K overfits, very large K underfits; K is a hyperparameter tuned e.g. by cross-validation.
  • SVM: finds decision boundary (hyperplane) with maximum margin; support vectors lie on margin edge; kernels (linear, polynomial, RBF, sigmoid) give nonlinear boundaries via implicit feature engineering; strong in high dimensions.
  • Naive Bayes: uses Bayes' theorem assuming independent features; fast, good for text/spam.

Trees, ensembles and neural networks

  • Decision tree: series of yes/no splits aiming for pure leaves.
  • Bagging: train models on bootstrap samples; random forest = many trees voting, with random feature exclusion to decorrelate trees.
  • Boosting: models trained in sequence, each fixing previous errors (AdaBoost, gradient boosting, XGBoost); often more accurate but more overfitting-prone and slower.
  • Neural networks: hidden layers learn hidden features automatically; many layers = deep learning.

Unsupervised methods

  • K-means: pick K random centers, assign points to nearest, recompute centers, repeat until stable.
  • Other clustering: hierarchical, DBSCAN (no K needed, arbitrary shapes).
  • Dimensionality reduction: PCA finds orthogonal directions of maximum variance; drop low-variance components.

Key terms

Feature
Input/independent variable used for prediction.
Label
Known true value of the target in training data.
Hyperparameter
Setting chosen before training, like K in KNN or K-means.
Overfitting
Fitting training data too closely so the model generalizes poorly.
Ensemble
Combining many simple models into a stronger one (bagging, boosting).
Principal component
Direction capturing maximal remaining variance in the data.

Takeaways

  • Labels present: supervised (regression or classification); no labels: unsupervised.
  • Hyperparameters like K trade off overfitting vs underfitting.
  • Random forests run trees in parallel; boosting runs them in sequence.
  • Kernels and neural networks perform implicit feature engineering.
Contribute

Was this lesson helpful?

We read every rating and fix the weakest lessons first.