Package org.apache.solr.ltr.model
Class MultipleAdditiveTreesModel
- java.lang.Object
- 
- org.apache.solr.ltr.model.LTRScoringModel
- 
- org.apache.solr.ltr.model.MultipleAdditiveTreesModel
 
 
- 
 public class MultipleAdditiveTreesModel extends LTRScoringModel A scoring model that computes scores based on the summation of multiple weighted trees. Example models are LambdaMART and Gradient Boosted Regression Trees (GBRT) .Example configuration: { "class" : "org.apache.solr.ltr.model.MultipleAdditiveTreesModel", "name" : "multipleadditivetreesmodel", "features":[ { "name" : "userTextTitleMatch"}, { "name" : "originalScore"} ], "params" : { "trees" : [ { "weight" : "1", "root": { "feature" : "userTextTitleMatch", "threshold" : "0.5", "left" : { "value" : "-100" }, "right" : { "feature" : "originalScore", "threshold" : "10.0", "left" : { "value" : "50" }, "right" : { "value" : "75" } } } }, { "weight" : "2", "root" : { "value" : "-10" } } ] } }Training libraries: Background reading: 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classMultipleAdditiveTreesModel.RegressionTreeclassMultipleAdditiveTreesModel.RegressionTreeNode
 - 
Field Summary- 
Fields inherited from class org.apache.solr.ltr.model.LTRScoringModelfeatures, name, norms
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.search.Explanationexplain(org.apache.lucene.index.LeafReaderContext context, int doc, float finalScore, List<org.apache.lucene.search.Explanation> featureExplanations)Similar to the score() function, except it returns an explanation of how the features were used to calculate the score.floatscore(float[] modelFeatureValuesNormalized)Given a list of normalized values for all features a scoring algorithm cares about, calculate and return a score.voidsetTrees(Object trees)StringtoString()protected voidvalidate()Validate that settings make sense and throwsModelExceptionif they do not make sense.- 
Methods inherited from class org.apache.solr.ltr.model.LTRScoringModelequals, getAllFeatures, getFeatures, getFeatureStoreName, getInstance, getName, getNormalizerExplanation, getNorms, getParams, hashCode, normalizeFeaturesInPlace
 
- 
 
- 
- 
- 
Method Detail- 
setTreespublic void setTrees(Object trees) 
 - 
validateprotected void validate() throws ModelExceptionDescription copied from class:LTRScoringModelValidate that settings make sense and throwsModelExceptionif they do not make sense.- Overrides:
- validatein class- LTRScoringModel
- Throws:
- ModelException
 
 - 
scorepublic float score(float[] modelFeatureValuesNormalized) Description copied from class:LTRScoringModelGiven a list of normalized values for all features a scoring algorithm cares about, calculate and return a score.- Specified by:
- scorein class- LTRScoringModel
- Parameters:
- modelFeatureValuesNormalized- List of normalized feature values. Each feature is identified by its id, which is the index in the array
- Returns:
- The final score for a document
 
 - 
explainpublic org.apache.lucene.search.Explanation explain(org.apache.lucene.index.LeafReaderContext context, int doc, float finalScore, List<org.apache.lucene.search.Explanation> featureExplanations)Description copied from class:LTRScoringModelSimilar to the score() function, except it returns an explanation of how the features were used to calculate the score.- Specified by:
- explainin class- LTRScoringModel
- Parameters:
- context- Context the document is in
- doc- Document to explain
- finalScore- Original score
- featureExplanations- Explanations for each feature calculation
- Returns:
- Explanation for the scoring of a document
 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- LTRScoringModel
 
 
- 
 
-