class DiscreteNaiveBayesModel implements IgniteModel<Vector, Double>, Exportable<DiscreteNaiveBayesModel>, Serializable {

    @Override public Double predict(Vector vector) {
        double maxProbapilityPower = -Double.MAX_VALUE;
        int maxLabelIndex = -1;

        for (int i = 0; i < clsProbabilities.length; i++) {
            double probabilityPower = Math.log(clsProbabilities[i]);

            for (int j = 0; j < probabilities[0].length; j++) {
                int x = toBucketNumber(vector.get(j), bucketThresholds[j]);
                double p = probabilities[i][j][x];
                probabilityPower += (p > 0 ? Math.log(p) : .0);
            }

            if (probabilityPower > maxProbapilityPower) {
                maxLabelIndex = i;
                maxProbapilityPower = probabilityPower;
            }
        }
        return labels[maxLabelIndex];
    }

    public  DiscreteNaiveBayesModel(double[][][] probabilities, double[] clsProbabilities, double[] labels,
        double[][] bucketThresholds, DiscreteNaiveBayesSumsHolder sumsHolder);

}