org.apache.ignite.ml.naivebayes.compound

## Class CompoundNaiveBayesModel

- java.lang.Object
- - org.apache.ignite.ml.naivebayes.compound.CompoundNaiveBayesModel

- All Implemented Interfaces:
    Serializable, AutoCloseable, DeployableObject, Exportable<CompoundNaiveBayesModel>, IgniteModel<Vector,Double>, JSONWritable, Model<Vector,Double>

      public class CompoundNaiveBayesModel
      extends Object
      implements IgniteModel<Vector,Double>, Exportable<CompoundNaiveBayesModel>, JSONWritable, DeployableObject

  A compound Naive Bayes model which uses a composition of`GaussianNaiveBayesModel` and `DiscreteNaiveBayesModel`.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompoundNaiveBayesModel()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CompoundNaiveBayesModel` | `fromJSON(Path path)` Loads CompoundNaiveBayesModel from JSON file.
    `List<Object>` | `getDependencies()` Returns dependencies of this object that can be object with class defined by client side and unknown for server.
    `Collection<Integer>` | `getDiscreteFeatureIdsToSkip()`
    `DiscreteNaiveBayesModel` | `getDiscreteModel()` Returns a discrete model.
    `Collection<Integer>` | `getGaussianFeatureIdsToSkip()`
    `GaussianNaiveBayesModel` | `getGaussianModel()` Returns a gaussian model.
    `double[]` | `getLabels()`
    `double[]` | `getPriorProbabilities()`
    `Double` | `predict(Vector vector)` Make a prediction for the specified input arguments.
    `<P> void` | `saveModel(Exporter<CompoundNaiveBayesModel,P> exporter, P path)` Save model by the given path.
    `void` | `toJSON(Path path)`
    `CompoundNaiveBayesModel` | `withDiscreteFeatureIdsToSkip(Collection<Integer> discreteFeatureIdsToSkip)` Sets feature ids to skip in discrete Bayes.
    `CompoundNaiveBayesModel` | `withDiscreteModel(DiscreteNaiveBayesModel discreteModel)` Sets a discrete model.
    `CompoundNaiveBayesModel` | `withGaussianFeatureIdsToSkip(Collection<Integer> gaussianFeatureIdsToSkip)` Sets feature ids to skip in Gaussian Bayes.
    `CompoundNaiveBayesModel` | `withGaussianModel(GaussianNaiveBayesModel gaussianModel)` Sets a gaussian model.
    `CompoundNaiveBayesModel` | `withLabels(double[] labels)` Sets labels.
    `CompoundNaiveBayesModel` | `withPriorProbabilities(double[] priorProbabilities)` Sets prior probabilities.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ignite.ml.IgniteModel

      `andBefore, andThen, andThen, close, combine, toString`

- - ### Constructor Detail

    - #### CompoundNaiveBayesModel

          public CompoundNaiveBayesModel()

  - ### Method Detail

    - #### saveModel

          public <P> void saveModel(Exporter<CompoundNaiveBayesModel,P> exporter,
                                    P path)

      Save model by the given path.
      Specified by:
        `saveModel` in interface `Exportable<CompoundNaiveBayesModel>`
      Parameters:
        `exporter` - Exporter.
        `path` - Path to saved model.

    - #### predict

          public Double predict(Vector vector)

      Make a prediction for the specified input arguments.
      Specified by:
        `predict` in interface `Model<Vector,Double>`
      Parameters:
        `vector` - Input arguments.
      Returns:
        Prediction result.

    - #### getGaussianModel

          public GaussianNaiveBayesModel getGaussianModel()

      Returns a gaussian model.

    - #### getDiscreteModel

          public DiscreteNaiveBayesModel getDiscreteModel()

      Returns a discrete model.

    - #### getPriorProbabilities

          public double[] getPriorProbabilities()

    - #### getLabels

          public double[] getLabels()

    - #### getGaussianFeatureIdsToSkip

          public Collection<Integer> getGaussianFeatureIdsToSkip()

    - #### getDiscreteFeatureIdsToSkip

          public Collection<Integer> getDiscreteFeatureIdsToSkip()

    - #### withPriorProbabilities

          public CompoundNaiveBayesModel withPriorProbabilities(double[] priorProbabilities)

      Sets prior probabilities.

    - #### withLabels

          public CompoundNaiveBayesModel withLabels(double[] labels)

      Sets labels.

    - #### withGaussianModel

          public CompoundNaiveBayesModel withGaussianModel(GaussianNaiveBayesModel gaussianModel)

      Sets a gaussian model.

    - #### withDiscreteModel

          public CompoundNaiveBayesModel withDiscreteModel(DiscreteNaiveBayesModel discreteModel)

      Sets a discrete model.

    - #### withGaussianFeatureIdsToSkip

          public CompoundNaiveBayesModel withGaussianFeatureIdsToSkip(Collection<Integer> gaussianFeatureIdsToSkip)

      Sets feature ids to skip in Gaussian Bayes.

    - #### withDiscreteFeatureIdsToSkip

          public CompoundNaiveBayesModel withDiscreteFeatureIdsToSkip(Collection<Integer> discreteFeatureIdsToSkip)

      Sets feature ids to skip in discrete Bayes.

    - #### getDependencies

          public List<Object> getDependencies()

      Returns dependencies of this object that can be object with class defined by client side and unknown for server.
      Specified by:
        `getDependencies` in interface `DeployableObject`

    - #### toJSON

          public void toJSON(Path path)

      Specified by:
        `toJSON` in interface `JSONWritable`

    - #### fromJSON

          public static CompoundNaiveBayesModel fromJSON(Path path)

      Loads CompoundNaiveBayesModel from JSON file.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021