Skip to content

    Probability & Statistics for ML

    Machine Learning · Beginner

    Definition

    Probability measures uncertainty; distributions, expectation and variance describe data.

    Every ML model is built on probability.

    Diagram

    P(A) ∈ [0,1]E[X]Var[X]

    Flowchart

    Define eventsCompute probabilitiesUse distributionsCompute expectation & variance

    Example: Expected value of a die

    faces = range(1, 7)
    e = sum(faces) / 6
    var = sum((f - e) ** 2 for f in faces) / 6
    print(e, round(var, 3))

    Output: 3.5 2.917

    Key points

    • Normal distribution is everywhere
    • Independent: P(A∩B) = P(A)P(B)

    Interview questions

    What is variance?

    Average squared distance from the mean.

    More Machine Learning topics