\hat{y} = \hat{f}(x) = \overset{C}{argmax}\underset{c=1}\> p(y = c|x, D)
produces this:
How can I use \underset to get c=1 under argmax?
I would suggest not using \underset and \overset but instead declaring argmax as an operator. In that way, argmax is also typeset correctly.
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator*{\argmax}{argmax}
\begin{document}
[
\hat{y} = \hat{f}(x) = \argmax_{c=1}^{C}> p(y = c|x, D)
]
\end{document}
Just put the \underset part inside the argument of the \overset:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
[
\hat{y} = \hat{f}(x) = \overset{C}{\underset{c=1}{argmax}}> p(y = c|x, D)
]
\end{document}
Edit: also, argmax isn't typeset correctly, it's an operator and shouldn't be rendered with slanted letters.
\operatorname*{argmax}_{c=1}^Cthat will do the right thing as well. Unfortunately KaTeX doesn't know\DeclareMathOperator. Anyway, KaTeX specific questions are off-topic on the site. – egreg May 05 '22 at 16:54\hat{y} = \hat{f}(x) = \argmax_{c=1}^{C}\> p(y = c|x, D)works. – Ben May 05 '22 at 16:57