Skip to content
All tags

#probability

31 posts

Feasibility of Learning: Hoeffding's Inequality and Guarantees Outside the Data | NTU Hsuan-Tien Lin Machine Learning Foundations Lecture 4

This lecture first shows that the data D alone cannot determine the answer outside D (No Free Lunch), then adds one assumption: the data and the future inputs are drawn independently from the same distribution. Hoeffding's inequality then guarantees that, for a hypothesis h fixed in advance, the probability that E_in and E_out differ by more than ε is at most 2exp(−2ε²N). An algorithm has to choose among M hypotheses, so the bound is multiplied by M and becomes 2M exp(−2ε²N); with finitely many hypotheses, enough data, and a small E_in, learning is feasible.

Linear Algebra / Calculus / Probability Warm-up + Fashion Coding | Berkeley CS189 Assignment 1

CS189 Spring 2026 HW1 has three pieces: ten written math warm-ups (a linear system, limits of matrix powers via eigendecomposition, SVD, a matrix that flips an image, partial derivatives, a chain rule over a recursion, and four probability problems including Bayes for cancer screening), plus two public Modal notebooks on Fashion-MNIST. Part 1 drills pandas / Plotly / K-means / an MLP / matrix-based image augmentation / tensor puzzles; Part 2 does price regression, MAE / MSE / R², confusion matrices, and finally a secret test set whose images have been rotated. Due Feb 20; no official solutions.

K-means, Probability Review, MLE, Multivariate Gaussians and GMMs | Berkeley CS189 Lectures 4–7

Lectures 4–7 of CS189 Spring 2026 tie unsupervised learning into one thread. K-means clusters the data, then its weaknesses show up: hard assignments, no probabilistic framing, and a bias toward round clusters of similar size. The course reviews probability, introduces maximum likelihood estimation (MLE) and multivariate Gaussians, and rewrites K-means as a Gaussian mixture model (GMM). The GMM log-likelihood has no closed-form solution, and that gap leads the course to gradient descent. All four lectures have slides and video; Discussions 2–3 come with solutions and walkthroughs.

MAP, How Priors Enter Estimation and Why That Equals Regularization | CMU 07-380 Lecture 8

Lecture 8 swaps MLE's argmax p(D|θ) for argmax p(θ|D). The prior p(θ) multiplies the likelihood, and after taking the negative log it becomes an extra term in the objective. A trick coin shows data overwhelming the prior, a Beta prior estimates a click rate, and Gaussian and Laplace priors on linear-regression weights turn into L2 and L1 regularization.

Bayes Nets Break a Joint Distribution into Conditional Probability Tables | CMU 07-380 Lecture 10

The Lec10 slides are not on the 07-380 course site yet, so this guide uses only the PR6 Bayes Nets pre-reading and the 15-281 Bayes Net Demo. A joint distribution can answer any query, but nobody hands it to you and it is too big to store; a Bayes net writes it as a product of 'node given parents' tables, and every missing edge is an independence assumption.

Uncertainty — Probability, Bayesian Networks, Markov Models & Genetic Inference | Harvard CS50 AI Week 2

Week 2 is about probability: conditional probability and Bayes' rule turn evidence into probabilities; a Bayesian network uses arrows to split a joint probability into one conditional probability table per node, inference by enumeration is exact but slow, and rejection sampling and likelihood weighting approximate it with samples; a Markov chain describes a state that changes over time with a transition model, and a hidden Markov model adds a sensor model to work back from observations to states you cannot see. With time links for every section, plus the approach and checks for the Heredity and PageRank projects.

Do These 4 Problems First — They Tell You What to Patch | Harvard CS181 Assignment 0

HW0 checks CS181 prerequisites in four problems — y=Xw solvability, optimizing an objective, reasoning about randomness, and OLS in Python. The problem that slows you down most is the gap to patch before HW1.

Unifying Logistic and Linear Regression with Maximum Likelihood | CMU 07-280 Lecture 16

Lecture 16 starts from likelihood p(D|θ), uses i.i.d. to factor the joint probability and logs to turn products into sums; Bernoulli MLE yields sample proportions, conditional Bernoulli yields logistic cross-entropy, and Gaussian noise yields squared error.

What is Probability?: List outcomes first; only then assign probabilities to events. | Stanford CS109 Lecture 1

List outcomes first; only then assign probabilities to events.

Conditional Probability: A condition restricts the sample space to outcomes still compatible with the evidence. | Stanford CS109 Lecture 2

A condition restricts the sample space to outcomes still compatible with the evidence.

Bayes Theorem: Bayes’ theorem turns an easier generative direction into the inferential direction we need. | Stanford CS109 Lecture 3

Bayes’ theorem turns an easier generative direction into the inferential direction we need.

Counting and Combinatorics: Decide whether order matters and repetition is allowed before choosing a formula. | Stanford CS109 Lecture 4

Decide whether order matters and repetition is allowed before choosing a formula.

Random Variables and Expectation: A random variable maps outcomes to numbers; expectation is a weighted average, not necessarily an attainable value. | Stanford CS109 Lecture 5

A random variable maps outcomes to numbers; expectation is a weighted average, not necessarily an attainable value.

Moments: Expectation, LOTUS, and linearity | Stanford CS109 Lecture 6

Expectation compresses a distribution into a weighted average; LOTUS handles transformed values, while linearity makes sums tractable even without independence.

Variance and Poisson: From spread to rare-event counts | Stanford CS109 Lecture 7

Variance describes a random variable's spread; Poisson models counts in a fixed interval and approximates a large-n, small-p binomial.

Continuous Random Variables: PDFs, CDFs, Uniform, and Exponential | Stanford CS109 Lecture 8

A continuous variable assigns zero probability to a point and area to intervals; CDFs, Uniform, Exponential, and memorylessness build on that distinction.

Normal Distribution: Standardization, Phi, and continuity correction | Stanford CS109 Lecture 9

Standardization maps Normal variables to Z; Phi, linear transforms, and continuity correction turn intervals and large binomials into computable probabilities.

Probabilistic Models: Joints, marginals, independence, and Bayes | Stanford CS109 Lecture 10

A joint distribution retains the full relationship among variables; marginals, conditionals, independence, and Bayes extract different answers from it.

Inference: Prior times likelihood, then normalize | Stanford CS109 Lecture 11

Inference multiplies each hidden-variable prior by an observation likelihood and normalizes; the same loop handles repeated evidence and discretized continuous beliefs.

General Inference: Bayesian networks, sampling, and rare evidence | Stanford CS109 Lecture 12

A Bayesian network factorizes a huge joint through conditional independence; ancestral sampling generates joint samples, and rejection sampling filters them into a conditional.

Multinomial: Category counts, bag of words, and log probability | Stanford CS109 Lecture 13

The Multinomial extends two-category Binomial counts to many categories; the same PMF models documents as word counts for Bayesian authorship with log-scores.

Beta: Turn an unknown probability into an updatable random variable | Stanford CS109 Lecture 14

A Beta distribution represents full belief about an unknown success rate; success/failure data updates two parameters for posteriors, smoothing, and Thompson-sampling decisions.

Adding Random Variables and the Central Limit Theorem | Stanford CS109 Lecture 15

A few independent sums have closed forms; general IID sums become approximately Normal under the CLT, with continuity correction for discrete sums.

Bootstrapping: Sampling statistics, error bars, and p-values | Stanford CS109 Lecture 16

The bootstrap treats a sample histogram as a population proxy, resampling with replacement to approximate a statistic's sampling distribution, error bar, or null p-value.

Algorithmic Analysis: Conditional expectation, indicators, and recursion | Stanford CS109 Lecture 17

Expected cost in randomized code can be conditioned on the first random choice; counting problems become indicator sums, often avoiding the full distribution entirely.

Information Theory: Surprise, entropy, information gain, and KL | Stanford CS109 Lecture 18

Surprise turns rare events into bits; entropy is expected surprise, information gain selects uncertainty-reducing questions, and KL measures excess cost from a model distribution.

Maximum Likelihood Estimation: Hold data fixed and optimize the parameter | Stanford CS109 Lecture 19

MLE fixes observed data and optimizes parameters; log-likelihood turns products into sums, but a maximum can also lie on a boundary.

Logistic Regression: Derive the gradient from Bernoulli likelihood | Stanford CS109 Lecture 20

Logistic regression turns a linear score into a Bernoulli probability with sigmoid; the gradient xⱼ(y-ŷ) follows directly from the log-likelihood chain rule.

Comparing Classifiers: Beyond accuracy to calibration, error costs, and fairness | Stanford CS109 Lecture 21

Classifier comparison requires held-out data, baselines, calibration, precision/recall, and an explicit fairness criterion—not accuracy alone.

Deep Learning: Derive backpropagation with the chain rule | Stanford CS109 Lecture 22

A neural network stacks logistic units; a forward pass computes probabilities, while backpropagation reuses output error to obtain every gradient.

Probability for Computer Scientists: From Counting and Inference to Machine Learning | Stanford CS109 Course Overview

CS109 is Stanford's probability course for computer scientists: it runs from counting, conditional probability and random variables to inference, maximum likelihood estimation, logistic regression and deep learning. The interactive course reader and the in-class worksheets with answer keys are public, and every lecture comes with an official LLM learning guide; slides after Lecture 15, the problem-set system and the recordings are closed to outsiders.