Given a population whose members each belong to one of a number of different sets or
classes, a classification rule or classifier is a procedure by which the elements of the population set are each predicted to belong to one of the classes. A perfect
classification Classification is a process related to categorization, the process in which ideas and objects are recognized, differentiated and understood.
Classification is the grouping of related facts into classes.
It may also refer to:
Business, organizat ...
is one for which every element in the population is assigned to the class it really belongs to. An imperfect classification is one in which some errors appear, and then
statistical analysis
Statistical inference is the process of using data analysis to infer properties of an underlying distribution of probability.Upton, G., Cook, I. (2008) ''Oxford Dictionary of Statistics'', OUP. . Inferential statistical analysis infers propertie ...
must be applied to analyse the classification.
A special kind of classification rule is
binary classification
Binary classification is the task of classifying the elements of a set into two groups (each called ''class'') on the basis of a classification rule. Typical binary classification problems include:
* Medical testing to determine if a patient has c ...
, for problems in which there are only two classes.
Testing classification rules
Given a data set consisting of pairs ''x'' and ''y'', where ''x'' denotes an element of the population and ''y'' the class it belongs to, a classification rule ''h''(''x'') is a function that assigns each element ''x'' to a predicted class
A binary classification is such that the label ''y'' can take only one of two values.
The true labels ''y
i'' can be known but will not necessarily match their approximations
. In a binary classification, the elements that are not correctly classified are named false positives and false negatives.
Some classification rules are static functions. Others can be computer programs. A
computer classifier can be able to learn or can implement static classification rules. For a training data-set, the true labels ''y
j'' are unknown, but it is a prime target for the classification procedure that the approximation
as well as possible, where the quality of this approximation needs to be judged on the basis of the statistical or probabilistic properties of the overall population from which future observations will be drawn.
Given a classification rule, a classification test is the result of applying the rule to a finite sample of the initial data set.
Binary and multiclass classification
Classification can be thought of as two separate problems –
binary classification
Binary classification is the task of classifying the elements of a set into two groups (each called ''class'') on the basis of a classification rule. Typical binary classification problems include:
* Medical testing to determine if a patient has c ...
and
multiclass classification
In machine learning and statistical classification, multiclass classification or multinomial classification is the problem of classifying instances into one of three or more classes (classifying instances into one of two classes is called binary c ...
. In binary classification, a better understood task, only two classes are involved, whereas multiclass classification involves assigning an object to one of several classes.
[ Har-Peled, S., Roth, D., Zimak, D. (2003) "Constraint Classification for Multiclass Classification and Ranking." In: Becker, B., Thrun, S., Obermayer, K. (Eds) ''Advances in Neural Information Processing Systems 15: Proceedings of the 2002 Conference'', MIT Press. ] Since many classification methods have been developed specifically for binary classification, multiclass classification often requires the combined use of multiple binary classifiers. An important point is that in many practical binary classification problems, the two groups are not symmetric – rather than overall accuracy, the relative proportion of different types of errors is of interest. For example, in medical testing, a false positive (detecting a disease when it is not present) is considered differently from a false negative (not detecting a disease when it is present). In multiclass classifications, the classes may be considered symmetrically (all errors are equivalent), or asymmetrically, which is considerably more complicated.
Binary classification methods include
probit regression
In statistics, a probit model is a type of regression where the dependent variable can take only two values, for example married or not married. The word is a portmanteau, coming from ''probability'' + ''unit''. The purpose of the model is to est ...
and
logistic regression
In statistics, the logistic model (or logit model) is a statistical model that models the probability of an event taking place by having the log-odds for the event be a linear function (calculus), linear combination of one or more independent var ...
. Multiclass classification methods include
multinomial probit
In statistics and econometrics, the multinomial probit model is a generalization of the probit model used when there are several possible categories that the dependent variable can fall into. As such, it is an alternative to the multinomial log ...
and
multinomial logit
In statistics, multinomial logistic regression is a classification method that generalizes logistic regression to multiclass problems, i.e. with more than two possible discrete outcomes. That is, it is a model that is used to predict the prob ...
.
Confusion Matrix and Classifiers
![binary-classification-labeled](https://upload.wikimedia.org/wikipedia/commons/6/65/Binary-classification-labeled.svg)
When the classification function is not perfect, false results will appear. In the example in the image to the right. There are 20 dots on the left side of the line (true side) while only 8 of those 20 were actually true. In a similar situation for the right side of the line (false side) where there are 16 dots on the right side and 4 of those 16 dots were inaccurately marked as true. Using the dot locations, we can build a confusion matrix to express the values. We can use 4 different metrics to express the 4 different possible outcomes. There is true positive (TP), false positive (FP), false negative (FN), and true negative (TN).
False positives
False positive
A false positive is an error in binary classification in which a test result incorrectly indicates the presence of a condition (such as a disease when the disease is not present), while a false negative is the opposite error, where the test result ...
s result when a test falsely (incorrectly) reports a positive result. For example, a
medical test
A medical test is a medical procedure performed to detect, diagnose, or monitor diseases, disease processes, susceptibility, or to determine a course of treatment. Medical tests such as, physical and visual exams, diagnostic imaging, genetic te ...
for a
disease
A disease is a particular abnormal condition that negatively affects the structure or function of all or part of an organism, and that is not immediately due to any external injury. Diseases are often known to be medical conditions that a ...
may return a positive result indicating that the patient has the disease even if the patient does not have the disease. False positive is commonly denoted as the top right (Condition negative X test outcome positive) unit in a
Confusion matrix
In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a su ...
.
False negatives
On the other hand,
false negative
A false positive is an error in binary classification in which a test result incorrectly indicates the presence of a condition (such as a disease when the disease is not present), while a false negative is the opposite error, where the test result ...
s result when a test falsely or incorrectly reports a negative result. For example, a medical test for a disease may return a negative result indicating that patient does not have a disease even though the patient actually has the disease. False negative is commonly denoted as the bottom left (Condition positive X test outcome negative) unit in a
Confusion matrix
In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a su ...
.
True positives
True positives result when a test correctly reports a positive result. As an example, a
medical test
A medical test is a medical procedure performed to detect, diagnose, or monitor diseases, disease processes, susceptibility, or to determine a course of treatment. Medical tests such as, physical and visual exams, diagnostic imaging, genetic te ...
for a
disease
A disease is a particular abnormal condition that negatively affects the structure or function of all or part of an organism, and that is not immediately due to any external injury. Diseases are often known to be medical conditions that a ...
may return a positive result indicating that the patient has the disease. This is shown to be true when the patient test confirms the existence of the disease. True positive is commonly denoted as the top left (Condition positive X test outcome positive) unit in a
Confusion matrix
In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a su ...
.
True negatives
True negative result when a test correctly reports a negative result. As an example, a
medical test
A medical test is a medical procedure performed to detect, diagnose, or monitor diseases, disease processes, susceptibility, or to determine a course of treatment. Medical tests such as, physical and visual exams, diagnostic imaging, genetic te ...
for a
disease
A disease is a particular abnormal condition that negatively affects the structure or function of all or part of an organism, and that is not immediately due to any external injury. Diseases are often known to be medical conditions that a ...
may return a positive result indicating that the patient does not have the disease. This is shown to be true when the patients test also reports not having the disease. True negative is commonly denoted as the bottom right (Condition negative X test outcome negative) unit in a
Confusion matrix
In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a su ...
.
Application with Bayes’ Theorem
We can also calculate true positives, false positive, true negative, and false negatives using
Bayes' theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For examp ...
. Using
Bayes' theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For examp ...
will help describe the
Probability
Probability is the branch of mathematics concerning numerical descriptions of how likely an Event (probability theory), event is to occur, or how likely it is that a proposition is true. The probability of an event is a number between 0 and ...
of an
Event (probability theory)
In probability theory, an event is a set of outcomes of an experiment (a subset of the sample space) to which a probability is assigned. A single outcome may be an element of many different events, and different events in an experiment are usua ...
, based on prior knowledge of conditions that might be related to the event. Expressed are the four classifications using the example below.
*If a tested patient does not have the disease, the test returns a positive result 5% of the time, or with a probability of 0.05.
*Suppose that only 0.1% of the population has that disease, so that a randomly selected patient has a 0.001 prior probability of having the disease.
*Let A represent the condition in which the patient has the disease
*Let \neg A represent the condition in which the patient does not have the disease
*Let B represent the evidence of a positive test result.
*Let \neg B represent the evidence of a negative test result.
In terms of true positive, false positive, false negative, and true negative:
*False positive is the probability P that \neg A (The patient does not have the disease) then B (The patient tests positive for the disease) also expressed as P(\neg A, B)
*False negative is the probability P that A (The patient has the disease) then \neg B (The patient tests negative for the disease) also expressed as P( A, \neg B)
*True positive is the probability P that A (The patient has the disease) then B (The patient tests positive for the disease) also expressed as P(A, B)
*True negative is the probability P that \neg A (The patient does not have the disease) then \neg B (The patient tests negative for the disease) also expressed as P(\neg A, \neg B)
False positives
We can use
Bayes' theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For examp ...
to determine the probability that a positive result is in fact a false positive. We find that if a disease is rare, then the majority of positive results may be false positives, even if the test is relatively accurate.
Naively, one might think that only 5% of positive test results are false, but that is quite wrong, as we shall see.
Suppose that only 0.1% of the population has that disease, so that a randomly selected patient has a 0.001 prior probability of having the disease.
We can use Bayes' theorem to calculate the probability that a positive test result is a false positive.
:
and hence the probability that a positive result is a false positive is about 1 − 0.019 = 0.98, or 98%.
Despite the apparent high accuracy of the test, the incidence of the disease is so low that the vast majority of patients who test positive do not have the disease. Nonetheless, the fraction of patients who test positive who do have the disease (0.019) is 19 times the fraction of people who have not yet taken the test who have the disease (0.001). Thus the test is not useless, and re-testing may improve the reliability of the result.
In order to reduce the problem of false positives, a test should be very accurate in reporting a ''negative'' result when the patient does not have the disease. If the test reported a negative result in patients without the disease with probability 0.999, then
:
so that 1 − 0.5 = 0.5 now is the probability of a false positive.
False negatives
We can use
Bayes' theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For examp ...
to determine the probability that the negative result is in fact a false negative using the example from above:
:
The probability that a negative result is a false negative is about 0.0000105 or 0.00105%. When a disease is rare, false negatives will not be a major problem with the test.
But if 60% of the population had the disease, then the probability of a false negative would be greater. With the above test, the probability of a false negative would be
:
The probability that a negative result is a false negative rises to 0.0155 or 1.55%.
True positives
We can use
Bayes' theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For examp ...
to determine the probability that the positive result is in fact a true positive using the example from above:
*If a tested patient has the disease, the test returns a positive result 99% of the time, or with a probability of 0.99.
*If a tested patient does not have the disease, the test returns a positive result 5% of the time, or with a probability of 0.05.
*Suppose that only 0.1% of the population has that disease, so that a randomly selected patient has a 0.001 prior probability of having the disease.
Let A represent the condition in which the patient has the disease, and B represent the evidence of a positive test result. Then, the probability that the patient actually has the disease given a positive test result is:
:
The probability that a positive result is a true positive is about 0.019%
True negatives
We can also use
Bayes' theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule), named after Thomas Bayes, describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For examp ...
to calculate the probability of true negative. Using the examples above:
*If a tested patient has the disease, the test returns a positive result 99% of the time, or with a probability of 0.99.
:
The probability that a negative result is a true negative is 0.9999494 or 99.99%. Since the disease is rare and the positive to positive rate is high and the negative to negative rate is also high, this will produce a large True Negative rate.
Measuring a classifier with sensitivity and specificity
In training a classifier, one may wish to measure its performance using the well-accepted metrics of sensitivity and specificity. It may be instructive to compare the classifier to a random classifier that flips a coin based on the prevalence of a disease. Suppose that the probability a person has the disease is
and the probability that they do not is
. Suppose then that we have a random classifier that guesses that the patient has the disease with that same probability
and guesses that he does not with the same probability
.
The probability of a true positive is the probability that the patient has the disease times the probability that the random classifier guesses this correctly, or
. With similar reasoning, the probability of a false negative is
. From the definitions above, the sensitivity of this classifier is
. With similar reasoning, we can calculate the specificity as
.
So, while the measure itself is independent of disease prevalence, the performance of this random classifier depends on disease prevalence. The classifier may have performance that is like this random classifier, but with a better-weighted coin (higher sensitivity and specificity). So, these measures may be influenced by disease prevalence. An alternative measure of performance is the
Matthews correlation coefficient
In statistics, the phi coefficient (or mean square contingency coefficient and denoted by φ or rφ) is a measure of association for two binary variables. In machine learning, it is known as the Matthews correlation coefficient (MCC) and used as a ...
, for which any random classifier will get an average score of 0.
The extension of this concept to non-binary classifications yields the
confusion matrix
In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a su ...
.
See also
*
Bayes classifier
*
Bayesian inference
Bayesian inference is a method of statistical inference in which Bayes' theorem is used to update the probability for a hypothesis as more evidence or information becomes available. Bayesian inference is an important technique in statistics, a ...
*
Binary classification
Binary classification is the task of classifying the elements of a set into two groups (each called ''class'') on the basis of a classification rule. Typical binary classification problems include:
* Medical testing to determine if a patient has c ...
*
Decision rule
In decision theory, a decision rule is a function which maps an observation to an appropriate action. Decision rules play an important role in the theory of statistics and economics, and are closely related to the concept of a strategy (game theory ...
*
Diagnostic test
A medical test is a medical procedure performed to detect, diagnose, or monitor diseases, disease processes, susceptibility, or to determine a course of treatment. Medical tests such as, physical and visual exams, diagnostic imaging, genetic ...
*
Gold standard (test)
In medicine and statistics, a gold standard test is usually the diagnostic test or benchmark that is the best available under reasonable conditions. In other words, a gold standard is the most accurate test possible without restrictions.
Both me ...
*
Loss functions for classification
In machine learning and mathematical optimization, loss functions for classification are computationally feasible loss functions representing the price paid for inaccuracy of predictions in classification problems (problems of identifying whic ...
*
Medical test
A medical test is a medical procedure performed to detect, diagnose, or monitor diseases, disease processes, susceptibility, or to determine a course of treatment. Medical tests such as, physical and visual exams, diagnostic imaging, genetic te ...
*
Sensitivity and specificity
''Sensitivity'' and ''specificity'' mathematically describe the accuracy of a test which reports the presence or absence of a condition. Individuals for which the condition is satisfied are considered "positive" and those for which it is not are ...
*
Statistical classification
In statistics, classification is the problem of identifying which of a set of categories (sub-populations) an observation (or observations) belongs to. Examples are assigning a given email to the "spam" or "non-spam" class, and assigning a diagno ...
Notes
References
{{reflist
Statistical classification