Package org.terrier.matching
Class JforestsModelMatching
- java.lang.Object
-
- org.terrier.matching.LearnedModelMatching
-
- org.terrier.matching.JforestsModelMatching
-
- All Implemented Interfaces:
Matching
public class JforestsModelMatching extends LearnedModelMatching
Applies a Jforests regression tree learned model to aFeaturedResultSet
. Learned model files are generated by Jforests. If you use this class, you are implicitly using the jforests library, and the Jforests citation policy applies.Properties
- fat.matching.learned.jforest.model - filename of the ensemble model generated by jforests
- fat.matching.learned.jforest.statistics - filename of the feature statistics file generated by jforests
- 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 JforestsModelMatching(Matching _parent)
JforestsModelMatching(Matching _parent, java.lang.String modelFilename)
JforestsModelMatching(Index _index, Matching _parent)
JforestsModelMatching(Index _index, Matching _parent, java.lang.String modelFilename)
JforestsModelMatching(Index _index, Matching _parent, java.lang.String modelFilename, java.lang.Class<? extends edu.uci.jforests.learning.trees.Tree> treeClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyModel(int N, double[] in_scores, int featureCount, double[][] doubleFeatures, double[] out_scores)
Apply the loaded learned model for identifying the top N documents.protected void
loadModel(java.lang.String model_filename)
protected void
loadModel(java.lang.String model_filename, java.lang.Class<? extends edu.uci.jforests.learning.trees.Tree> treeClass)
protected edu.uci.jforests.dataset.RankingDataset
makeDataset(int N, int featureCount, double[][] doubleFeatures)
-
Methods inherited from class org.terrier.matching.LearnedModelMatching
getInfo, match, setCollectionStatistics
-
-
-
-
Constructor Detail
-
JforestsModelMatching
public JforestsModelMatching(Index _index, Matching _parent) throws java.lang.Exception
- Throws:
java.lang.Exception
-
JforestsModelMatching
public JforestsModelMatching(Matching _parent) throws java.lang.Exception
- Throws:
java.lang.Exception
-
JforestsModelMatching
public JforestsModelMatching(Matching _parent, java.lang.String modelFilename) throws java.lang.Exception
- Throws:
java.lang.Exception
-
JforestsModelMatching
public JforestsModelMatching(Index _index, Matching _parent, java.lang.String modelFilename) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
loadModel
protected void loadModel(java.lang.String model_filename) throws java.lang.Exception
- Throws:
java.lang.Exception
-
loadModel
protected void loadModel(java.lang.String model_filename, java.lang.Class<? extends edu.uci.jforests.learning.trees.Tree> treeClass) throws java.lang.Exception
- Throws:
java.lang.Exception
-
makeDataset
protected edu.uci.jforests.dataset.RankingDataset makeDataset(int N, int featureCount, double[][] doubleFeatures)
-
applyModel
protected void applyModel(int N, double[] in_scores, int featureCount, double[][] doubleFeatures, 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 scoresfeatureCount
- number of featuresdoubleFeatures
- indexed by feature THEN documentout_scores
- - final scores
-
-