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, norms
NULL_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, ramBytesUsed
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildResources
public void setTrees(Object trees)
protected void validate() throws ModelException
LTRScoringModel
ModelException
if they do not make sense.validate
in class LTRScoringModel
ModelException
public float score(float[] modelFeatureValuesNormalized)
LTRScoringModel
score
in class LTRScoringModel
modelFeatureValuesNormalized
- 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)
LTRScoringModel
explain
in class LTRScoringModel
context
- Context the document is indoc
- Document to explainfinalScore
- Original scorefeatureExplanations
- Explanations for each feature calculationpublic String toString()
toString
in class LTRScoringModel
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.