public static int {method_name}(double[] atts) {{
    if (atts.length != {n_features}) {{
        return -1;
    }}
    int i, j;

    {priors}
    {sigmas}
    {thetas}
    double[] likelihoods = new double[{n_classes}];

    for (i = 0; i < {n_classes}; i++) {{
        double sum = 0.;
        for (j = 0; j < {n_features}; j++) {{
            sum += Math.log(2. * Math.PI * sigmas[i][j]);
        }}
        double nij = -0.5 * sum;
        sum = 0.;
        for (j = 0; j < {n_features}; j++) {{
            sum += Math.pow(atts[j] - thetas[i][j], 2.) / sigmas[i][j];
        }}
        nij -= 0.5 * sum;
        likelihoods[i] = Math.log(priors[i]) + nij;
    }}

    double highestLikeli = Double.NEGATIVE_INFINITY;
    int classIndex = -1;
    for (i = 0; i < {n_classes}; i++) {{
        if (likelihoods[i] > highestLikeli) {{
            highestLikeli = likelihoods[i];
            classIndex = i;
        }}
    }}
    return classIndex;
}}