The short answer
In machine learning, “hypothesis” usually means one of two things. It can be a candidate function that a learner proposes to map inputs to outputs. Or it can be a claim that a statistical test checks against data, written as a null hypothesis (H0) and an alternative hypothesis (H1). Most of the “types” people look for come from these two senses, plus a few terms that describe groups of candidate functions and how a learner chooses among them.
Hypotheses as candidate functions
In this sense, a hypothesis is a function h that takes an input x and returns a prediction. Suppose you want to estimate a house’s sale price from its floor area and its number of bedrooms. A simple linear hypothesis could look like this:
price = w1 × floor area + w2 × bedrooms + b
Training adjusts the weights w1 and w2 and the intercept b so the function fits the training examples. The fitted function is the hypothesis. Many courses write it as h(x), or as h_θ(x) to show that it depends on parameters θ.
Fitting the training examples is only part of the job. A useful hypothesis also predicts well on inputs it has never seen, a property called generalization. A function that only memorizes its training data has not learned a rule that transfers to new cases.
Hypothesis space and hypothesis classes
The hypothesis space is the full set of functions a learning algorithm is allowed to choose from. Its shape depends on the model family. Hypotheses are often grouped by family:
- Linear hypotheses describe straight-line or flat-plane relationships, as in linear and logistic regression.
- Decision tree hypotheses are built from if-then splits on input features.
- Neural network hypotheses are layered functions with many adjustable weights.
- Instance-based hypotheses make predictions from stored training examples near a new input, rather than from one fixed formula. k-nearest neighbors is a familiar case, and the stored examples are what define its hypothesis. For that idea in more detail, see instance-based learning in machine learning examples.
Simple and complex hypotheses are another common way to describe these groups. A straight line is a simple hypothesis. A high-degree polynomial, or a large neural network with many weights, is complex. A richer space can fit more patterns, but it also has more room to memorize noise, which leads to overfitting. A very restricted space may miss real structure, which is underfitting.
Consistent hypotheses and the version space
A hypothesis is consistent with a set of training examples if it gets every one of them right. The version space is the part of the hypothesis space that contains only consistent hypotheses.
Textbook examples often assume clean, noise-free data, where at least one consistent hypothesis exists. Real data usually contains errors and noise, so a perfect fit may not exist. In that case, learners settle for a hypothesis that makes few mistakes, and they accept that it will not match every training example.
Null and alternative hypotheses
In statistics, a hypothesis test compares two claims:
- H0 (null hypothesis) is the default claim, usually that there is no effect or no difference.
- H1 (alternative hypothesis) is the claim the test looks for evidence for, such as a difference or an improvement.
The test turns the data into a test statistic and then a p-value. The p-value is the probability of seeing a result at least as extreme as the one observed, assuming H0 is true. If the p-value falls below a threshold chosen before the test, often 0.05 by convention, the result is called statistically significant and H0 is rejected. Failing to reject H0 does not prove it true.
Two kinds of error are possible. A type I error rejects a true H0. A type II error fails to reject a false H0.
In machine learning, these tests are used to compare models or experiments. If two classifiers are scored on the same test set, H0 can say that their error rates are the same. The data then shows whether the observed gap is larger than chance would explain.
How the two senses fit together
The two senses do different jobs. A learner searches a hypothesis space for a good candidate function. A statistical test asks whether a difference, such as the gap between two candidates, is likely to be real. The first is about finding a function. The second is about judging a claim about one or more functions.
The two meet often in practice. Held-out evaluation, where a model is scored on data it did not train on, supplies the data for the comparison. This overlap is one reason machine learning borrows so much from statistics.
Inductive bias and choosing among hypotheses
When several hypotheses fit the training data equally well, a learner needs a reason to prefer one. That reason is its inductive bias: the built-in assumptions about which kinds of functions are more likely to generalize. Preferring simpler functions is a common example, though it is a heuristic, not a guarantee.
The no free lunch rule in machine learning says that, averaged over all possible problems, no learning method performs better than the others. The best hypothesis therefore depends on the problem, and so does the bias that suits it.
Hypothesis, model and parameters
In everyday practice the words overlap. A model usually means a family of functions with adjustable parameters, such as a linear model or a neural network. Training picks specific parameter values, and the resulting function is the hypothesis the model commits to. Parameters are the numbers a learner adjusts. A hypothesis is the function those numbers define.
Summary
- In machine learning, a hypothesis is a candidate function that maps inputs to predictions.
- The hypothesis space is the set of candidates a learner can choose from, grouped into hypothesis classes such as linear, tree, neural network and instance-based.
- A consistent hypothesis matches all the training examples, and the version space holds every consistent hypothesis.
- In statistics, H0 is the default claim and H1 is what the test looks for evidence for.
- Inductive bias is the set of preferences that decides between hypotheses that fit the data equally well.