Hypotheses in ML

What is the main function of a hypothesis?

In machine learning, a hypothesis maps inputs to predictions, and in statistics it is a testable claim. Here is what each role does and why it matters.

On this page
  1. The short answer
  2. What a hypothesis does in machine learning
  3. Why a learner needs one
  4. Generalization and memorization
  5. What a hypothesis does in statistics
  6. Telling the two senses apart
  7. Common misreadings
  8. Summary

The short answer

In machine learning, the main function of a hypothesis is to turn an input into a prediction. A good hypothesis gives sensible predictions not only for the examples it was trained on but also for new inputs. In statistics, a hypothesis has a different job: it is a clear claim that data can support or weaken.

What a hypothesis does in machine learning

A hypothesis is a function that maps inputs to outputs. A spam filter’s hypothesis takes an email and outputs “spam” or “not spam”. A house-price model’s hypothesis takes a home’s details and outputs a number. Each candidate function a learner considers is a hypothesis, and training is the process of choosing one of them.

Once training finishes, the chosen hypothesis is what runs when a new input arrives. For many models, that means applying a fixed formula with learned weights. Some methods, such as nearest-neighbor methods, need the stored training examples at prediction time, but the idea is the same: the hypothesis is the rule the learner uses to answer new questions.

Why a learner needs one

Training data is a finite set of examples. Many different functions can fit those examples, and they can disagree sharply on inputs they never saw. A hypothesis commits the learner to one rule that can be applied to any new input. Moving from specific examples to a general rule is the core of inductive learning.

Choosing the right rule is not always easy. The no free lunch rule in machine learning says that no single method is best for every problem, so the hypothesis that works well depends on the data and the task.

Generalization and memorization

Generalization means performing well on data the learner has not seen. A hypothesis that memorizes its training examples, including their noise, can look excellent on the training set and poor on new data. This is overfitting.

To catch overfitting, learners often hold some data back from training and score the hypothesis on it. This held-out check is one of the main ways to see whether the hypothesis has learned a rule rather than a list of answers.

What a hypothesis does in statistics

In statistics, a hypothesis is a testable claim. Tests usually compare two of them: the null hypothesis (H0), which is the default claim of no effect, and the alternative hypothesis (H1). The data is collected, and a test measures how surprising that data would be if H0 were true.

Here the hypothesis gives the test something definite to evaluate. The test weighs evidence against H0, but it does not prove or disprove anything with certainty. Machine learning borrows this idea when it compares two models, which is one reason the two fields overlap so much.

Telling the two senses apart

Context usually makes the meaning clear:

  • In a discussion of models, training or predictions, a hypothesis means a candidate function.
  • In an experiment, an A/B test or a comparison of results, a hypothesis means a claim tested against H0 or H1.
  • When someone refers to the hypothesis space, they mean the whole set of candidate functions, not a single one.

Common misreadings

  • A hypothesis is not a hunch you hope is true. In machine learning it is a function; in statistics it is a claim with a test attached.
  • A learned hypothesis is not guaranteed to be right. It is an approximation of the pattern in the data, and it can fail on new cases.
  • Failing to reject H0 does not confirm H0. It means the data did not give enough evidence against it.

Summary

  • In machine learning, the main function of a hypothesis is to map inputs to predictions that hold up on new data.
  • Training chooses one hypothesis from a larger set of candidates.
  • In statistics, a hypothesis is a testable claim, and the test weighs the evidence for it.

The complete guide to hypotheses in ml

Types of Hypothesis in Machine Learning
Read the guide

Keep exploring

Guides from other topics

All topics →