The cost function given as $\hat{\beta} = (Y - \beta X)^T (Y-\beta X)$ is used to evaluate the weights $\beta$. Here $X$ is the data and $Y$ is the output. On taking the derivative, we get the estimates of the weights. This is a Least Squares formulation.
1) Can Least Squares (LS) be used when the observation (outputs) $y_i$, $i=1,2,..,N$ number of examples are categorical? I don't quite get the picture how classification problems using LS works in terms of derivative for categorical cases.
2) Can LS be used when the data $X$ is a one-hot encoding? Would the formulation and derivative be the same?