public static function {name}($atts) {{
    if (sizeof($atts) != {n_features}) {{ return -1; }}

    {coefficients}
    {intercepts}

    $class_idx = -1;
    $class_val = null;
    for ($i = 0; $i < {n_classes}; $i++) {{
        $prob = 0.;
        for ($j = 0; $j < {n_features}; $j++) {{
            $prob += $coefs[$i][$j] * $atts[$j];
        }}
        if (is_null($class_val) || $prob + $inters[$i] > $class_val) {{
            $class_val = $prob + $inters[$i];
            $class_idx = $i;
        }}
    }}
    return $class_idx;
}}