Documentation of 'org.encog.ml.bayesian.BayesianEvent' Java class
BayesianEvent
org.encog.ml.bayesian

Class BayesianEvent

  • All Implemented Interfaces:
    java.io.Serializable


    public class BayesianEvent
    extends java.lang.Object
    implements java.io.Serializable
    Events make up a Bayesian network. Each evidence or outcome event usually corresponds to one number in the training data. A event is always discrete. However, continues values can be range-mapped to discrete values.
    See Also:
    Serialized Form
    • Constructor Detail

      • BayesianEvent

        public BayesianEvent(java.lang.String theLabel,
                             java.util.List<BayesianChoice> theChoices)
        Construct an event with the specified label and choices.
        Parameters:
        theLabel - The label.
        theChoices - The choices, or states.
      • BayesianEvent

        public BayesianEvent(java.lang.String theLabel,
                             java.lang.String[] theChoices)
        Construct an event with the specified label and choices.
        Parameters:
        theLabel - The label.
        theChoices - The choices, or states.
      • BayesianEvent

        public BayesianEvent(java.lang.String theLabel)
        Construct a boolean event.
        Parameters:
        theLabel - The label.
    • Method Detail

      • getParents

        public java.util.List<BayesianEvent> getParents()
        Returns:
        the parents
      • getChildren

        public java.util.List<BayesianEvent> getChildren()
        Returns:
        the children
      • getLabel

        public java.lang.String getLabel()
        Returns:
        the label
      • addChild

        public void addChild(BayesianEvent e)
        Add a child event.
        Parameters:
        e - The child event.
      • addParent

        public void addParent(BayesianEvent e)
        Add a parent event.
        Parameters:
        e - The parent event.
      • hasParents

        public boolean hasParents()
        Returns:
        True, if this event has parents.
      • hasChildren

        public boolean hasChildren()
        Returns:
        True, if this event has parents.
      • toFullString

        public java.lang.String toFullString()
        Returns:
        A full string that contains all info for this event.
      • toString

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

        public int calculateParameterCount()
        Returns:
        The parameter count.
      • getChoices

        public java.util.Set<BayesianChoice> getChoices()
        Returns:
        the choices
      • finalizeStructure

        public void finalizeStructure()
        Finalize the structure.
      • validate

        public void validate()
        Validate the event.
      • isBoolean

        public boolean isBoolean()
        Returns:
        True, if this is a boolean event.
      • rollArgs

        public boolean rollArgs(double[] args)
        Roll the specified arguments through all of the possible values, return false if we are at the final iteration. This is used to enumerate through all of the possible argument values of this event.
        Parameters:
        args - The arguments to enumerate.
        Returns:
        True if there are more iterations.
      • removeAllRelations

        public void removeAllRelations()
        Remove all relations.
      • formatEventName

        public static java.lang.String formatEventName(BayesianEvent event,
                                                       int value)
        Format the event name with +, - and =. For example +a or -1, or a=red.
        Parameters:
        event - The event to format.
        value - The value to format for.
        Returns:
        The formatted name.
      • hasGiven

        public boolean hasGiven(java.lang.String l)
        Return true if the event has the specified given event.
        Parameters:
        l - The event to check for.
        Returns:
        True if the event has the specified given.
      • reset

        public void reset()
        Reset the logic table.
      • matchChoiceToRange

        public int matchChoiceToRange(double d)
        Match a continuous value to a discrete range. This is how floating point numbers can be used as input to a Bayesian network.
        Parameters:
        d - The continuous value.
        Returns:
        The range that the value was mapped into.
      • getChoice

        public BayesianChoice getChoice(int arg)
        Return the choice specified by the index. This requires searching through a list. Do not call in performance critical areas.
        Parameters:
        arg - The argument number.
        Returns:
        The bayesian choice found.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.