Documentation of 'jsat.classifiers.bayesian.graphicalmodel.DiscreteBayesNetwork' Java class
DiscreteBayesNetwork
jsat.classifiers.bayesian.graphicalmodel

Class DiscreteBayesNetwork

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Classifier
    Direct Known Subclasses:
    K2NetworkLearner


    public class DiscreteBayesNetwork
    extends java.lang.Object
    implements Classifier
    A class for representing a Baysian Network (BN) for discrete variables. A BN use a graph to representing the relations between variables, and these links are called the structure. The structure of a BN must be specified by an expert using the depends(int, int) method. The target class should be specified as the parent of the variables which have a causal relationship to it. These children of the target class should then have their own children specified. Once the structure has been specified, the network can be trained and used for classification.
    If the network structure has not been specified, or has no relationships for the target class, the BN will create an edge from the target class to every variable. If no edges were ever specified, this initialization of edges corresponds to a NaiveBayes implementation.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static boolean DEFAULT_USE_PRIORS
      Whether or not the classifier should take into account the prior probabilities.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      CategoricalResults classify(DataPoint data)
      Performs classification on the given data point.
      Classifier clone() 
      void depends(int parent, int child)
      Adds a dependency relation ship between two variables that will be in the network.
      boolean supportsWeightedData()
      Indicates whether the model knows how to train using weighted data points.
      void train(ClassificationDataSet dataSet)
      Trains the classifier and constructs a model for classification using the given data set.
      void train(ClassificationDataSet dataSet, boolean parallel)
      Trains the classifier and constructs a model for classification using the given data set.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_USE_PRIORS

        public static final boolean DEFAULT_USE_PRIORS
        Whether or not the classifier should take into account the prior probabilities. Default value is true.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DiscreteBayesNetwork

        public DiscreteBayesNetwork()
    • Method Detail

      • classify

        public CategoricalResults classify(DataPoint data)
        Description copied from interface: Classifier
        Performs classification on the given data point.
        Specified by:
        classify in interface Classifier
        Parameters:
        data - the data point to classify
        Returns:
        the results of the classification.
      • depends

        public void depends(int parent,
                            int child)
        Adds a dependency relation ship between two variables that will be in the network. The integer value corresponds the the index of the i'th categorical variable, where the class target's value is the number of categorical variables.
        Parameters:
        parent - the parent variable, which will be explained in part by the child
        child - the child variable, which contributes to the conditional probability of the parent.
      • train

        public void train(ClassificationDataSet dataSet,
                          boolean parallel)
        Description copied from interface: Classifier
        Trains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.
        Specified by:
        train in interface Classifier
        Parameters:
        dataSet - the data set to train on
        parallel - true if multiple threads should be used to train the model. false if it should be done in a single threaded manner.
      • train

        public void train(ClassificationDataSet dataSet)
        Description copied from interface: Classifier
        Trains the classifier and constructs a model for classification using the given data set.
        Specified by:
        train in interface Classifier
        Parameters:
        dataSet - the data set to train on
      • supportsWeightedData

        public boolean supportsWeightedData()
        Description copied from interface: Classifier
        Indicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.
        Specified by:
        supportsWeightedData in interface Classifier
        Returns:
        true if the model supports weighted data, false otherwise
      • clone

        public Classifier clone()
        Specified by:
        clone in interface Classifier
        Overrides:
        clone in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.