# Bayes Optimal Classification Rule

Cross Validated Asked by John on November 28, 2020

Suppose that $$Y∈ {0,1}$$ and $$P(Y=1) = 1/2$$. The distribution of $$X|Y= 0$$ is discrete and is specified by $$P(X= 1|Y= 0) = 1/3$$ $$P(X= 2|Y= 0) = 2/3$$The distribution of $$X|Y= 1$$ is discrete and is given by $$P(X= 2|Y= 1) = 1/3$$ $$P(X= 3|Y= 1) = 2/3$$

This is all I can find about the Bayes Classifier in my textbook:

How would I be able to find the Bayes Classifier?

Bayes classifier chooses the class with maximum posterior probability. Since there are two classes, if $$P(Y=1|X=x)geq1/2$$ it means posterior for class $$1$$ is the maximum one, and we choose it. That is why if $$eta(X)geq 1/2$$, it chooses class $$1$$.

The formula for the posterior you've shared at the end is correct. You just need to be careful about calling the negative class as $$0$$ or $$-1$$, and make sure $$X$$ values given in class conditional probabilities are correct (e.g. the upper one deals with $$X=1,2$$ and the lower one deals with $$X=2,3$$). In the end, you'll have a function that for each $$X$$ value, a class label is assigned.

Answered by gunes on November 28, 2020

## Related Questions

### Normalize sample to match the mean and the standard deviation

1  Asked on November 22, 2020

### Cross validation and parameter tuning

5  Asked on November 20, 2020 by sana-sudheer

### How does the Dyna Q algorithm works?

1  Asked on November 19, 2020 by nolw38

### Posterior mean of $mu$ in Bayesian Hierarchical model (Poisson-Gamma)

0  Asked on November 17, 2020 by maverick-meerkat

### Contextualising post-hoc tests following repeated one-way ANOVA

1  Asked on November 17, 2020 by dc_liv

### Interpreting SAS output – Roots of AR Characteristic Polynomial

0  Asked on November 14, 2020 by user819749

### ReLU outperforming Softplus

1  Asked on November 12, 2020 by mike-land

### Latest research and explanation on how semi-supervised learning is performing better than supervised?

0  Asked on November 12, 2020 by aaryan-bhagat

### How do I interpret model fit for ordinal regression when AICc and likelihood ratio test conflict?

0  Asked on November 9, 2020 by monica

### Obtaining the complete confidence intervals of binary interacted variables

1  Asked on November 9, 2020 by arun

### What test shall I use to validate the use of a certain score to predict my outcome in a survival analysis?

1  Asked on November 8, 2020

### Individual sampling weights and percentages

1  Asked on November 6, 2020 by seth-c

### he_normal (Keras) is truncated when kaiming_normal_ (pytorch) is not

1  Asked on November 3, 2020 by londumas

### How do I treat my Confounding variables in my multivariate Linear Mixed Model?

1  Asked on October 29, 2020 by thomas-lordick

### Bayesian Likelihood function range

1  Asked on October 29, 2020 by shamm

### Convergence of bootstrap standard error estimate (one of the problems from Efron’s book)

0  Asked on October 26, 2020 by mattjosh

### Zero inflated continuous outcome variables

0  Asked on October 26, 2020 by michaelkyei

### How to test paired observations

1  Asked on October 23, 2020 by doug-fir

### How to project a mxn matrix (m features, n samples) onto a space generated by a mxk matrix (m features, k factors)?

0  Asked on October 20, 2020 by minstein