Package org.terrier.matching
Class LearnedModelMatching
- java.lang.Object
-
- org.terrier.matching.LearnedModelMatching
-
- All Implemented Interfaces:
Matching
- Direct Known Subclasses:
JforestsModelMatching,LinearModelMatching
public abstract class LearnedModelMatching extends java.lang.Object implements Matching
An abstract class for applying a learned model onto aFeaturedResultSet.- Since:
- 4.0
- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description protected intincrementprotected org.slf4j.Loggerloggerprotected Matchingparentprotected booleanscore_is_feature
-
Constructor Summary
Constructors Modifier Constructor Description protectedLearnedModelMatching(Matching _parent)protectedLearnedModelMatching(Index _index, Matching _parent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidapplyModel(int N, double[] in_scores, int F, double[][] features, double[] out_scores)Apply the loaded learned model for identifying the top N documents.java.lang.StringgetInfo()Return a human readable description of this Matching classResultSetmatch(java.lang.String queryNumber, MatchingQueryTerms queryTerms)Get a ResultSet for the given query terms.voidsetCollectionStatistics(CollectionStatistics cs)Update the collection statistics being used by this matching instance
-
-
-
Field Detail
-
parent
protected final Matching parent
-
logger
protected org.slf4j.Logger logger
-
score_is_feature
protected final boolean score_is_feature
-
increment
protected final int increment
-
-
Method Detail
-
applyModel
protected abstract 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.- Parameters:
N- - number of documentsin_scores- - sample scoresF- number of featuresfeatures- indexed by feature THEN documentout_scores- - final scores
-
match
public ResultSet match(java.lang.String queryNumber, MatchingQueryTerms queryTerms) throws java.io.IOException
Description copied from interface:MatchingGet a ResultSet for the given query terms.
-
setCollectionStatistics
public void setCollectionStatistics(CollectionStatistics cs)
Description copied from interface:MatchingUpdate the collection statistics being used by this matching instance- Specified by:
setCollectionStatisticsin interfaceMatching- Parameters:
cs- CollectionStatistics to use during matching
-
-