aboutsummaryrefslogtreecommitdiffstats
path: root/model-integration/src/main/java/ai/vespa/rankingexpression/importer/lightgbm/LightGBMNode.java
blob: f8eb2531e5dace20d8374f6174ff6863a12397bb (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.rankingexpression.importer.lightgbm;

/**
 * @author lesters
 */
public class LightGBMNode {

    // split nodes
    private int split_feature;
    private String threshold;  // double for numerical, string for categorical
    private String decision_type;
    private boolean default_left;
    private String missing_type;
    private int internal_count;
    private LightGBMNode left_child;
    private LightGBMNode right_child;

    // leaf nodes
    private double leaf_value;
    private int leaf_count;

    public int getSplit_feature() {
        return split_feature;
    }

    public String getThreshold() {
        return threshold;
    }

    public String getDecision_type() {
        return decision_type;
    }

    public boolean isDefault_left() {
        return default_left;
    }

    public String getMissing_type() {
        return missing_type;
    }

    public int getInternal_count() {
        return internal_count;
    }

    public LightGBMNode getLeft_child() {
        return left_child;
    }

    public LightGBMNode getRight_child() {
        return right_child;
    }

    public double getLeaf_value() {
        return leaf_value;
    }

    public int getLeaf_count() {
        return leaf_count;
    }

    public boolean isLeaf() {
        return left_child == null && right_child == null;
    }

}