Package ai.vespa.models.evaluation
Class FunctionEvaluator
java.lang.Object
ai.vespa.models.evaluation.FunctionEvaluator
An evaluator which can be used to evaluate a single function once.
- Author:
- bratseth
-
Method Summary
Modifier and TypeMethodDescriptionBinds the given variable referred in this expression to the given value.Binds the given variable referred in this expression to the given value.Binds the given variable referred in this expression to the given value.context()com.yahoo.tensor.Tensorevaluate()com.yahoo.searchlib.rankingexpression.ExpressionFunctionfunction()Returns the function evaluated by thissetMissingValue(double value) Sets the default value to use for variables which are not boundsetMissingValue(com.yahoo.tensor.Tensor value) Sets the default value to use for variables which are not bound
-
Method Details
-
bind
Binds the given variable referred in this expression to the given value.- Parameters:
name- the variable to bindvalue- the value this becomes bound to- Returns:
- this for chaining
-
bind
Binds the given variable referred in this expression to the given value. This is equivalent tobind(name, Tensor.Builder.of(TensorType.empty).cell(value).build())- Parameters:
name- the variable to bindvalue- the value this becomes bound to- Returns:
- this for chaining
-
bind
Binds the given variable referred in this expression to the given value. String values are not yet supported in tensors.- Parameters:
name- the variable to bindvalue- the value this becomes bound to- Returns:
- this for chaining
-
setMissingValue
Sets the default value to use for variables which are not bound- Parameters:
value- the default value- Returns:
- this for chaining
-
setMissingValue
Sets the default value to use for variables which are not bound- Parameters:
value- the default value- Returns:
- this for chaining
-
evaluate
public com.yahoo.tensor.Tensor evaluate() -
function
public com.yahoo.searchlib.rankingexpression.ExpressionFunction function()Returns the function evaluated by this -
context
-