<?php

class {class_name} {{

    public function __construct($nClasses, $nRows, $vectors, $coefficients, $intercepts, $weights, $kernel, $gamma, $coef0, $degree) {{
        $this->nClasses = $nClasses;
        $this->classes = array_fill(0, $nClasses, 0);
        for ($i = 0; $i < $nClasses; $i++) {{
            $this->classes[$i] = $i;
        }}
        $this->nRows = $nRows;

        $this->vectors = $vectors;
        $this->coefficients = $coefficients;
        $this->intercepts = $intercepts;
        $this->weights = $weights;

        $this->kernel = strtoupper($kernel);
        $this->gamma = $gamma;
        $this->coef0 = $coef0;
        $this->degree = $degree;
    }}

    {method}

}}

if ($argc > 1) {{

    // Features:
    array_shift($argv);
    $features = $argv;

    // Parameters:
    {vectors}
    {coefficients}
    {intercepts}
    {weights}

    // Prediction:
    $clf = new {class_name}({n_classes}, {n_svs_rows}, $vectors, $coefficients, $intercepts, $weights, "{kernel}", {gamma}, {coef0}, {degree});
    $prediction = $clf->{method_name}($features);
    fwrite(STDOUT, $prediction);

}}