All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.schemas.NaiveBayesModelV3 Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
package hex.schemas;

import hex.naivebayes.NaiveBayesModel;
import water.api.API;
import water.api.schemas3.ModelOutputSchemaV3;
import water.api.schemas3.ModelSchemaV3;
import water.api.schemas3.TwoDimTableV3;

public class NaiveBayesModelV3 extends ModelSchemaV3 {
  public static final class NaiveBayesModelOutputV3 extends ModelOutputSchemaV3 {
    // Output fields; input fields are in the parameters list
    @API(help = "Categorical levels of the response")
    public String[] levels;

    @API(help = "A-priori probabilities of the response")
    public TwoDimTableV3 apriori;

    @API(help = "Conditional probabilities of the predictors")
    public TwoDimTableV3[] pcond;
  }

  // TODO: I think we can implement the following two in ModelSchemaV3, using reflection on the type parameters.
  public NaiveBayesV3.NaiveBayesParametersV3 createParametersSchema() { return new NaiveBayesV3.NaiveBayesParametersV3(); }
  public NaiveBayesModelOutputV3 createOutputSchema() { return new NaiveBayesModelOutputV3(); }

  // Version&Schema-specific filling into the impl
  @Override public NaiveBayesModel createImpl() {
    NaiveBayesModel.NaiveBayesParameters parms = parameters.createImpl();
    return new NaiveBayesModel( model_id.key(), parms, null );
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy