Class QNModel

    • Constructor Summary

      Constructors 
      Constructor Description
      QNModel​(Context[] params, java.lang.String[] predLabels, java.lang.String[] outcomeNames)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      static double[] eval​(int[] context, float[] values, double[] probs, int nOutcomes, int nPredLabels, double[] parameters)
      Model evaluation which should be used during training to report model accuracy.
      double[] eval​(java.lang.String[] context)
      Evaluates a context.
      double[] eval​(java.lang.String[] context, double[] probs)
      Evaluates a context.
      double[] eval​(java.lang.String[] context, float[] values)
      Evaluates a contexts with the specified context values.
      int getNumOutcomes()
      Returns the number of outcomes for this model.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QNModel

        public QNModel​(Context[] params,
                       java.lang.String[] predLabels,
                       java.lang.String[] outcomeNames)
    • Method Detail

      • eval

        public double[] eval​(java.lang.String[] context)
        Description copied from interface: MaxentModel
        Evaluates a context.
        Parameters:
        context - A list of String names of the contextual predicates which are to be evaluated together.
        Returns:
        an array of the probabilities for each of the different outcomes, all of which sum to 1.
      • eval

        public double[] eval​(java.lang.String[] context,
                             double[] probs)
        Description copied from interface: MaxentModel
        Evaluates a context.
        Parameters:
        context - A list of String names of the contextual predicates which are to be evaluated together.
        probs - An array which is populated with the probabilities for each of the different outcomes, all of which sum to 1.
        Returns:
        an array of the probabilities for each of the different outcomes, all of which sum to 1.
      • eval

        public double[] eval​(java.lang.String[] context,
                             float[] values)
        Description copied from interface: MaxentModel
        Evaluates a contexts with the specified context values.
        Parameters:
        context - A list of String names of the contextual predicates which are to be evaluated together.
        values - The values associated with each context.
        Returns:
        an array of the probabilities for each of the different outcomes, all of which sum to 1.
      • eval

        public static double[] eval​(int[] context,
                                    float[] values,
                                    double[] probs,
                                    int nOutcomes,
                                    int nPredLabels,
                                    double[] parameters)
        Model evaluation which should be used during training to report model accuracy.
        Parameters:
        context - Indices of the predicates which have been observed at the present decision point.
        values - Weights of the predicates which have been observed at the present decision point.
        probs - Probability for outcomes
        nOutcomes - Number of outcomes
        nPredLabels - Number of unique predicates
        parameters - Model parameters
        Returns:
        Normalized probabilities for the outcomes given the context.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object