Documentation of 'org.encog.ml.bayesian.query.sample.SamplingQuery' Java class
SamplingQuery
org.encog.ml.bayesian.query.sample

Class SamplingQuery

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, BayesianQuery


    public class SamplingQuery
    extends BasicQuery
    implements java.io.Serializable
    A sampling query allows probabilistic queries on a Bayesian network. Sampling works by actually simulating the probabilities using a random number generator. A sample size must be specified. The higher the sample size, the more accurate the probability will be. However, the higher the sampling size, the longer it takes to run the query. An enumeration query is more precise than the sampling query. However, the enumeration query will become slow as the size of the Bayesian network grows. Sampling can often be used for a quick estimation of a probability.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_SAMPLE_SIZE

        public static final int DEFAULT_SAMPLE_SIZE
        The default sample size.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SamplingQuery

        public SamplingQuery(BayesianNetwork theNetwork)
        Construct a sampling query.
        Parameters:
        theNetwork - The network that will be queried.
    • Method Detail

      • getSampleSize

        public int getSampleSize()
        Returns:
        the sampleSize
      • setSampleSize

        public void setSampleSize(int sampleSize)
        Parameters:
        sampleSize - the sampleSize to set
      • execute

        public void execute()
        Execute the query.
        Specified by:
        execute in interface BayesianQuery
      • getProbability

        public double getProbability()
        Specified by:
        getProbability in interface BayesianQuery
        Returns:
        Obtains the probability after execute has been called.
      • dumpCurrentState

        public java.lang.String dumpCurrentState()
        Returns:
        The current state as a string.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.