blob: e761c162c3af90920e865e28281e6f3068fffd30 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.gbdt;
import com.yahoo.searchlib.rankingexpression.evaluation.DoubleValue;
import com.yahoo.searchlib.rankingexpression.evaluation.Value;
import java.util.Arrays;
import java.util.Optional;
/**
* A GBDT node representing a numeric "less than" comparison: feature < numeric-value
*
* @author bratseth
*/
public final class NumericFeatureNode extends FeatureNode {
private final Value value;
public NumericFeatureNode(String feature, Value value, Optional<Integer> samples, TreeNode left, TreeNode right) {
super(feature, samples, left, right);
this.value = value;
}
/** Returns a copy of the array of values in this */
public Value value() {
return value;
}
@Override
public String rankingExpressionCondition() {
return " < " + value;
}
}
|