public class MultipleAdditiveTreesModel extends LTRScoringModel
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:
| Modifier and Type | Class and Description |
|---|---|
class |
MultipleAdditiveTreesModel.RegressionTree |
class |
MultipleAdditiveTreesModel.RegressionTreeNode |
features, name, normsNULL_ACCOUNTABLE| Constructor and Description |
|---|
MultipleAdditiveTreesModel(String name,
List<Feature> features,
List<Normalizer> norms,
String featureStoreName,
List<Feature> allFeatures,
Map<String,Object> params) |
| Modifier and Type | Method and Description |
|---|---|
Explanation |
explain(LeafReaderContext context,
int doc,
float finalScore,
List<Explanation> featureExplanations)
Similar to the score() function, except it returns an explanation of how
the features were used to calculate the score.
|
float |
score(float[] modelFeatureValuesNormalized)
Given a list of normalized values for all features a scoring algorithm
cares about, calculate and return a score.
|
void |
setTrees(Object trees) |
String |
toString() |
protected void |
validate()
Validate that settings make sense and throws
ModelException if they do not make sense. |
equals, getAllFeatures, getFeatures, getFeatureStoreName, getInstance, getName, getNormalizerExplanation, getNorms, getParams, hashCode, normalizeFeaturesInPlace, ramBytesUsedclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildResourcespublic void setTrees(Object trees)
protected void validate()
throws ModelException
LTRScoringModelModelException if they do not make sense.validate in class LTRScoringModelModelExceptionpublic float score(float[] modelFeatureValuesNormalized)
LTRScoringModelscore in class LTRScoringModelmodelFeatureValuesNormalized - List of normalized feature values. Each feature is identified by
its id, which is the index in the arraypublic Explanation explain(LeafReaderContext context, int doc, float finalScore, List<Explanation> featureExplanations)
LTRScoringModelexplain in class LTRScoringModelcontext - Context the document is indoc - Document to explainfinalScore - Original scorefeatureExplanations - Explanations for each feature calculationpublic String toString()
toString in class LTRScoringModelCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.