Class LinearModelMatching

  • All Implemented Interfaces:
    Matching

    public class LinearModelMatching
    extends LearnedModelMatching
    Applies a linear learned model to a FeaturedResultSet. Learned model files take the format featureid:weight
    Since:
    4.0
    Author:
    Craig Macdonald
    • Constructor Detail

      • LinearModelMatching

        public LinearModelMatching​(Index _index,
                                   Matching _parent,
                                   double[] _weights)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • LinearModelMatching

        public LinearModelMatching​(Index _index,
                                   Matching _parent,
                                   java.lang.String _modelFilename)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • LinearModelMatching

        public LinearModelMatching​(Index _index,
                                   Matching _parent)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • applyModel

        protected void applyModel​(int N,
                                  double[] in_scores,
                                  int F,
                                  double[][] features,
                                  double[] out_scores)
        Description copied from class: LearnedModelMatching
        Apply the loaded learned model for identifying the top N documents.
        Specified by:
        applyModel in class LearnedModelMatching
        Parameters:
        N - - number of documents
        in_scores - - sample scores
        F - number of features
        features - indexed by feature THEN document
        out_scores - - final scores
      • loadFeatureWeights

        public static double[] loadFeatureWeights​(java.lang.String input)
                                           throws java.io.IOException
        Throws:
        java.io.IOException