public static int {method_name}(float[] atts) {{
    if (atts.length != {n_features}) {{ return -1; }}
    int[] classes = new int[{n_classes}];
    {branches}

    int class_idx = 0;
    int class_val = classes[0];
    for (int i = 1; i < {n_classes}; i++) {{
        if (classes[i] > class_val) {{
            class_idx = i;
            class_val = classes[i];
        }}
    }}
    return class_idx;
}}