{% extends '_skeleton.jinja' %}

{% block predict %}
    float votes[{{ classes|length }}] = { 0.0f };

    {% include 'gaussiannb/vote.jinja' %}
    {% include 'vote.jinja' %}
{% endblock %}

{% block protected %}
    /**
     * Compute gaussian value
     */
    float gauss(float *x, float *theta, float *sigma) {
        float gauss = 0.0f;

        for (uint16_t i = 0; i < {{ theta[0]|length }}; i++) {
            gauss += log(sigma[i]);
            gauss += abs(x[i] - theta[i]) / sigma[i];
        }

        return gauss;
    }
{% endblock %}