Class OnlineLearning


  • public final class OnlineLearning
    extends Object
    Adapts the parameters of a Bayesian network, using Bayesian statistics.
    • Constructor Detail

      • OnlineLearning

        public OnlineLearning​(Network network,
                              InferenceFactory factory)
        Initializes a new instance of the OnlineLearning class. Learning uses inference as a subroutine, and creates one or more inference engines via the [factory] parameter.
        Parameters:
        network - The network whose parameters are being adapted.
        factory - The inference factory used to create inference engines in cases when learning requires inference.
    • Method Detail

      • getEvidence

        public Evidence getEvidence()
        Gets the evidence used internally. Setting evidence on this instance, and passing it to Adapt saves a copy.
      • adapt

        public void adapt​(Evidence evidence,
                          OnlineLearningOptions options)
                   throws InconsistentEvidenceException
        Adapt the parameters of a Bayesian network using Bayesian statistics.

        For nodes to be adapted, they must have Experience tables assigned (and optionally fading tables).

        In the case a discrete node, the experience table combined with the probability are used to create a Dirichlet distribution. This distribution acts as a prior during the Bayesian inference process.

        Parameters:
        evidence - The evidence to learn.
        options - Options that affect how parameters are adapted.
        Throws:
        InconsistentEvidenceException