\Section{ml}
    \desc{Machine-Learning}{}{}
    \desc[german]{Maschinelles Lernen}{}{}

    \Subsection{performance}
        \desc{Performance metrics}{}{}
        \desc[german]{Metriken zur Leistungsmessung}{}{}

        \eng[cp]{correct predictions}
        \ger[cp]{richtige Vorhersagen}
        \eng[fp]{false predictions}
        \ger[fp]{falsche Vorhersagen}

        \eng[y]{ground truth}
        \eng[yhat]{prediction}
        \ger[y]{Wahrheit}
        \ger[yhat]{Vorhersage}

        \eng[n_desc]{Number of data points}
        \ger[n_desc]{Anzahl der Datenpunkte}

        \begin{formula}{accuracy}
            \desc{Accuracy}{}{}
            \desc[german]{Genauigkeit}{}{}
            \eq{a = \frac{\tGT{::cp}}{\tGT{::fp} + \tGT{::cp}}}
        \end{formula}
        \begin{formula}{mean_abs_error}
            \desc{Mean absolute error (MAE)}{}{$y$ \GT{::y}, $\hat{y}$ \GT{::yhat}, $n$ \GT{::n_desc}}
            \desc[german]{Mittlerer absoluter Fehler (MAE)}{}{}
            \eq{\text{MAE} = \frac{1}{n} \sum_{i=1}^n \abs{y_i - \hat{y}_i}}
        \end{formula}
        \begin{formula}{mean_square_error}
            \desc{Mean squared error (MSE)}{}{$y$ \GT{::y}, $\hat{y}$ \GT{::yhat}, $n$ \GT{::n_desc}}
            \desc[german]{Methode der kleinsten Quadrate (MSE)}{Quadratwurzel des mittleren quadratischen Fehlers (SME)}{}
            \eq{\text{MSE} = \frac{1}{n} \sum_{i=1}^n \left(y_i - \hat{y}_i\right)^2}
        \end{formula}
        \begin{formula}{root_mean_square_error}
            \desc{Root mean squared error (RMSE)}{}{$y$ \GT{::y}, $\hat{y}$ \GT{::yhat}, $n$ \GT{::n_desc}}
            \desc[german]{Standardfehler der Regression}{Quadratwurzel des mittleren quadratischen Fehlers (RSME)}{}
            \eq{\text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^n \left(y_i - \hat{y}_i\right)^2}}
        \end{formula}

    \Subsection{reg}
        \desc{Regression}{}{}
        \desc[german]{Regression}{}{}
        \Subsubsection{linear}
            \desc{Linear Regression}{}{}
            \desc[german]{Lineare Regression}{}{}
            \begin{formula}{eq}
                \desc{Linear regression}{Fits the data under the assumption of \fRef[normally distributed errors]{math:pt:distributions:cont:normal}}{$\mat{x}\in\R^{N\times M}$ input data, $\mat{y}\in\R^{N\times L}$ output data, $\mat{b}$ bias, $\vec{\beta}$ weights, $N$ samples, $M$ features, $L$ output variables}
                \desc[german]{Lineare Regression}{Fitted Daten unter der Annahme \fRef[normalverteilter Fehler]{math:pt:distributions:cont:normal}}{}
                \eq{\mat{y} = \mat{\epsilon} + \mat{x} \cdot \vec{\beta}}
            \end{formula}
            \begin{formula}{design_matrix}
                \desc{Design matrix}{Stack column of ones to the feature vector\\Useful when $\epsilon$ is scalar}{$x_{ij}$ feature $j$ of sample $i$}
                \desc[german]{Designmatrix Ansatz}{}{}
                \eq{
                    \mat{X} = \begin{pmatrix} 1 & x_{11} & \ldots & x_{1M} \\  \vdots & \vdots & \vdots & \vdots \\ 1 & x_{N1} & \ldots & x_{NM} \end{pmatrix} 
                }
            \end{formula}       
            \begin{formula}{scalar_bias}
                \desc{Linear regression with scalar bias}{Using the design matrix, the scalar is absorbed into the weight vector}{$\mat{y}$ output data, $\mat{X}$ \fRef{::design_matrix}, $\vec{\beta}$ weights}
                \desc[german]{Lineare Regression mit skalarem Bias}{Durch die Designmatrix wird der Bias in den Gewichtsvektor absorbiert}{}
                \eq{\mat{y} = \mat{X} \cdot \vec{\beta}}
            \end{formula}
            \begin{formula}{normal_equation}
                \desc{Normal equation}{Solves \fRef{comp:ml:reg:linear:scalar_bias} with \fRef{comp:ml:performance:mean_square_error}}{$\mat{y}$ output data, $\mat{X}$ \fRef{::design_matrix}, $\vec{\beta}$ weights}
                \desc[german]{Normalengleichung}{Löst \fRef{comp:ml:reg:linear:scalar_bias} mit \fRef{comp:ml:performance:mean_square_error}}{}
                \eq{\vec{\beta} = \left(\mat{X}^\T \mat{X}\right)^{-1} \mat{X}^T \mat{y}}
            \end{formula}

        \Subsubsection{kernel}
            \desc{Kernel method}{}{}
            \desc[german]{Kernelmethode}{}{}
            \begin{formula}{kernel_trick}
                \desc{Kernel trick}{}{$\vecx_i \in \R^{M_1}$ input vectors, $M_1$ dimension of data vector space, $M_2$ dimension of feature space}
                % \desc[german]{}{}{}
                \ttxt{\eng{
                    Useful when transforming the input data $x$ into a much higher dimensional space ($M_2 \gg M_1$) $\Phi: \R^{M_1} \mapsto \R^{M_2},\quad \vecx \to \Phi(\vecx)$ 
                    and only the dot product of this transformed data $\Phi(x)^\T\Phi(x)$ is required.
                    Then the dot product can be replaced by a suitable kernel function $\kappa$.
                }}
                \eq{
                    k(\vecx_i,\vecx_j) \equiv \Phi(\vecx_i)^{\T} \Phi(\vecx_j)
                }
            \end{formula}   

            \begin{formula}{common_kernels}
                \desc{Common kernels}{}{}
                % \desc[german]{}{}{}
                % \eq{}
                \ttxt{\eng{
                    Linear, Polynomial, Sigmoid, Laplacian, radial basis funciton (RBF)
                }}
            \end{formula}

            \begin{formula}{radial_basis_function}
                \abbrLabel{RBF}
                \desc{Radial basis function kernel (RBF)}{RBF = Real function of which the value only depends on the distance of the input}{}
                \desc[german]{Radiale Basisfunktion-Kernel (RBF)}{RBF = Reelle Funktion, deren Wert nur vom Abstand zum Ursprung abängt}{}
                \eq{k(\vecx_i, \vecx_j) = \Exp{-\frac{\norm{\vecx_i - \vecx_j}_2^2}{\sigma}}}
            \end{formula}

        \Subsubsection{bayes}
            \desc{Bayesian regression}{}{}
            \desc[german]{Bayes'sche Regression}{}{}

            \begin{formula}{linear_regression}
                \desc{Bayesian linear regression}{}{}
                \desc[german]{Bayes'sche lineare Regression}{}{}
                \ttxt{\eng{
                        Assume a \fRef{math:pt:bayesian:prior} distribution over the weights.
                        Offers uncertainties in addition to the predictions.
                }}
            \end{formula}

            \begin{formula}{ridge}
                \desc{Ridge regression}{Regularization method}{}
                \desc[german]{Ridge Regression}{}{}
                \ttxt{\eng{
                    Applies a L2 norm penalty on the weights.
                    This ensures unimportant features are less regarded and do not encode noise.
                    \\Corresponds to assuming a \fRef{math:pt:bayesian:prior} \absRef{multivariate_normal_distribution} with $\vec{\mu} = 0$ and independent components ($\mat{\Sigma}$) for the weights.
                }\ger{
                    Reduziert Gewichte mit der L2-Norm.
                    Dadurch werden unwichtige Features nicht berücksichtigt (kleines Gewicht) und enkodieren nicht Noise.
                    \\Entspricht der Annahme einer \absRef[Normalverteilung]{multivariate_normal_distribution} mit $\vec{\mu}=0$ und unanhängingen Komponenten ($\mat{Sigma}$ diagonaol) der die Gewichte als \fRef{math:pt:bayesian:prior}.
                }}
            \end{formula}

            \begin{formula}{ridge_weights}
                \desc{Optimal weights}{for ridge regression}{$\lambda = \frac{\sigma^2}{\xi^2}$ shrinkage parameter, $\xi$ \absRef{variance} of the gaussian \fRef{math:pt:bayesian:prior}, $\sigma$ \absRef{variance} of the gaussian likelihood of the data}
                \desc[german]{Optimale Gewichte}{für Ridge Regression}{}
                \eq{\vec{\beta} = \left(\mat{X}^\T \mat{X} + \lambda \mathcal{1} \right)^{-1} \mat{X}^\T \vecy}
            \end{formula}

            \begin{formula}{lasso}
                \desc{Lasso regression}{Least absolute shrinkage and selection operator\\Regularization method}{}
                \desc[german]{Lasso Regression}{}{}
                \ttxt{\eng{
                    Applies a L1 norm penalty on the weights, which means features can be disregarded entirely.
                    \\Corresponds to assuming a \absRef{laplace_distribution} for the weights as \fRef{math:pt:bayesian:prior}.
                }\ger{
                    Reduziert Gewichte mit der L1-Norm.
                    Unwichtige Features werden reduziert und können auch ganz vernachlässigt werden und enkodieren nicht Noise.
                    \\Entspricht der Annahme einer \absRef[Laplace-Verteilung]{laplace_distribution} der die Gewichte als \fRef{math:pt:bayesian:prior}. 
                }}
            \end{formula}


        
        \begin{formula}{gaussion_process_regression}
            \desc{Gaussian process regression (GPR)}{}{}
            % \desc[german]{}{}{}
            \ttxt{\eng{
                Gaussian process: A distribtuion over functions that produce jointly gaussian distribution.
                Multivariate normal distribution like \fRef{:::linear_regression}, except that $\vec{\mu}$ and $\mat{\Sigma}$ are functions.
                GPR: non-parametric Bayesion regressor, does not assume fixed functional form for the underlying data, instead, the data determines the functional shape,
                with predictions governed by the covariance structure defined by the kernel (often \abbrRef{radial_basis_function}).

                Offers uncertainties in addition to the predictions.
                \TODO{cleanup}
            }}
        \end{formula}
        

        \begin{formula}{soap}
            \desc{Smooth overlap of atomic atomic positions (SOAP)}{}{}
            % \desc[german]{}{}{}
            \ttxt{\eng{
                Goal: symmetric invariance, smoothness, completeness (completeness not achieved)
                \\Gaussian smeared density expanded in \abbrRef{radial_basis_function} and spherical harmonics.
            }}
        \end{formula}   

        \begin{formula}{gaussian_approximation_potential}
        \desc{Gaussian approximation potential}{Bond-order potential}{$V_\text{rep/attr}$ repulsive / attractive potential}
            % \desc[german]{}{}{}
            \ttxt{\eng{
                Models atomic interactions via a \textit{bond-order} term $b$.
            }}
            \eq{V_\text{BondOrder}(\vecR_M, \vecR_N) = V_\text{rep}(\vecR_M, \vecR_N) + b_{MNK} V_\text{attr}(\vecR_M, \vecR_N)}
        \end{formula}

    \Subsection{gd}
        \desc{Gradient descent}{}{}
        \desc[german]{Gradientenverfahren}{}{}
        \TODO{in lecture 30 CMP}

