Does an LDA classifier separate the classes at 0? I am reading some code where the prediction of a test trial's class amounts to whether its value after being transformed by the LDA weights is above or below 0. This is confusing to me as I see no reference to classes being split or separated at 0 in the resources I've been using to understand LDAs.
For any matlabbers, here is the code I'm seeing:
acc =  squeeze(mean((Xhat>0)==permute(repmat(Y,1,nSamples),[2,1]),2));

Where Xhat is the output of the LDA decoder (i.e. X*W) and is a matrix of size no. samples x no. trials where the samples are just different timepoints at which the classification is performed.
Y is a vector of true class labels that are either 0 or 1.
I understand the logic of the code, but not the theory behind how that creates an accuracy measure - does it mean that after projecting the new trial into the space defined by LDA weights, one class has negative values and one class has positive values?
 A: LDA is a simplification of QDA in which you compare two quantities given some data $\mathbf{x}$: the likelihood of $\mathbf{x}$ given it comes from class $1$ denoted $p(\mathbf{x}\mid c=1)$ is compared to the likelihood for another class (which we denote $0$) denoted $p(\mathbf{x}\mid c=0)$. LDA and QDA both ask the following question:

Is the likelihood of $\mathbf{x}$ given $c=1$ much bigger than the likelihood given $c=0$ ?

Specifically, they ask whether $\dfrac{p(\mathbf{x}\mid c=1)}{p(\mathbf{x}\mid c=0)} > t$.
The equivalent inequality is this: do we have that $p(\mathbf{x}\mid c=1)$ is $t$ times bigger then $p(\mathbf{x}\mid c=0)$ ?
Often the question is asked in $\log$ space where you only have to perform substraction, and the inequality becomes
$$ \log p(\mathbf{x}\mid c=1) - \log p(\mathbf{x}\mid c=0) > \log t$$
So if you want to predict class $1$ whenever $p(\mathbf{x}\mid c=1) > p(\mathbf{x}\mid c=0)$, you should set $t$ to $1$. This means that $\log t = \log 1 = 0$.
The code you're reading is right to compare the $\log$ of the ratio to $0$ !
