Hypothesis Testing

1 min read

A hypothesis test asks whether observed data is surprising under a null hypothesis.

Null hypothesis H0H_0: default claim, often "no effect" or "no difference."

Alternative hypothesis H1H_1: claim you need evidence for.

Example:

  • H0H_0: model A and model B have equal expected accuracy
  • H1H_1: model A has higher expected accuracy than model B

Test statistic: a number computed from the data whose distribution is known or approximated under H0H_0.

p-value: probability, assuming H0H_0 is true, of observing a test statistic at least as extreme as the one observed.

p=P(data as extreme or more extremeH0)p = P(\text{data as extreme or more extreme} \mid H_0)

Decision rule: reject H0H_0 if p<αp < \alpha, where α\alpha is the significance level, often 0.05.

What a p-value is not:

  • It is not P(H0data)P(H_0 \mid \text{data})
  • It is not the probability the result is false
  • It does not measure effect size
  • It does not guarantee practical importance

In ML: hypothesis tests can compare models, but they must respect dependence. If two models are evaluated on the same test examples, use paired tests or bootstrap differences, not independent-sample tests.

See also: Statistical Power, Statistical Significance vs Practical Significance, Bootstrap and Resampling

Linked from