Package org.terrier.matching
Class LinearModelMatching
- java.lang.Object
-
- org.terrier.matching.LearnedModelMatching
-
- org.terrier.matching.LinearModelMatching
-
- All Implemented Interfaces:
Matching
public class LinearModelMatching extends LearnedModelMatching
Applies a linear learned model to aFeaturedResultSet
. Learned model files take the format featureid:weight- Since:
- 4.0
- Author:
- Craig Macdonald
-
-
Field Summary
-
Fields inherited from class org.terrier.matching.LearnedModelMatching
increment, logger, parent, score_is_feature
-
-
Constructor Summary
Constructors Constructor Description LinearModelMatching(Index _index, Matching _parent)
LinearModelMatching(Index _index, Matching _parent, double[] _weights)
LinearModelMatching(Index _index, Matching _parent, java.lang.String _modelFilename)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyModel(int N, double[] in_scores, int F, double[][] features, double[] out_scores)
Apply the loaded learned model for identifying the top N documents.static double[]
loadFeatureWeights(java.lang.String input)
-
Methods inherited from class org.terrier.matching.LearnedModelMatching
getInfo, match, setCollectionStatistics
-
-
-
-
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
-
-
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 classLearnedModelMatching
- Parameters:
N
- - number of documentsin_scores
- - sample scoresF
- number of featuresfeatures
- indexed by feature THEN documentout_scores
- - final scores
-
loadFeatureWeights
public static double[] loadFeatureWeights(java.lang.String input) throws java.io.IOException
- Throws:
java.io.IOException
-
-