-
Notifications
You must be signed in to change notification settings - Fork 0
/
xgboost_gen.go
100 lines (82 loc) · 3.06 KB
/
xgboost_gen.go
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package arboreal
// generated by "schematyper pkg/xgb/xgboost_schema.json -c"
// minor edits for readability/usability (i.e. removing interfaces)
type aftLossParam struct {
AftLossDistribution string `json:"aft_loss_distribution,omitempty"`
AftLossDistributionScale string `json:"aft_loss_distribution_scale,omitempty"`
}
type featureName string
type featureType string
type GBTree struct {
Model model `json:"model"`
Name string `json:"name"`
}
type gbtreeModelParam struct {
NumTrees string `json:"num_trees"`
NumParallelTree string `json:"num_parallel_tree"`
}
type lambdaRankParam struct {
FixListWeight string `json:"fix_list_weight,omitempty"`
NumPairsample string `json:"num_pairsample,omitempty"`
}
type learner struct {
FeatureNames []featureName `json:"feature_names,omitempty"`
FeatureTypes []featureType `json:"feature_types,omitempty"`
GradientBooster GradientBooster `json:"gradient_booster"`
LearnerModelParam learnerModelParam `json:"learner_model_param,omitempty"`
Objective Objective `json:"objective"`
}
type learnerModelParam struct {
BaseScore float32 `json:"base_score,omitempty"`
NumClass int `json:"num_class,omitempty"`
NumFeature int `json:"num_feature,omitempty"`
NumTarget int `json:"num_target,omitempty"`
}
type model struct {
GbtreeModelParam gbtreeModelParam `json:"gbtree_model_param"`
// TreeInfo []treeInfoItem `json:"tree_info"`
Trees []*tree `json:"trees"`
}
type pseduoHuberParam struct {
HuberSlope string `json:"huber_slope,omitempty"`
}
type regLossParam struct {
ScalePosWeight string `json:"scale_pos_weight,omitempty"`
}
type softmaxMulticlassParam struct {
NumClass string `json:"num_class,omitempty"`
}
type tree struct {
// BaseWeights []float32 `json:"base_weights"`
CategoriesSizes []int `json:"categories_sizes,omitempty"`
Categories []int `json:"categories"`
CategoriesNodes []int `json:"categories_nodes"`
CategoriesSegments []int `json:"categories_segments"`
// DefaultLeft determines when feature is unknown, whether goes to left child
DefaultLeft []int `json:"default_left"`
ID int `json:"id,omitempty"`
LeftChildren []int `json:"left_children"`
RightChildren []int `json:"right_children"`
SplitConditions []float32 `json:"split_conditions"`
SplitIndices []int `json:"split_indices"`
SplitType []int `json:"split_type,omitempty"`
Leaves []bool
// Parents []int `json:"parents"`
// TreeParam treeTreeParam `json:"tree_param"`
// SumHessian []float32 `json:"sum_hessian"`
// LossChanges []float32 `json:"loss_changes"`
}
type treeInfoItem int
type treeTreeParam struct {
NumFeature string `json:"num_feature"`
NumNodes string `json:"num_nodes"`
SizeLeafVector string `json:"size_leaf_vector"`
}
type XGBoostSchema struct {
Learner *learner `json:"learner"`
Version []int `json:"version"`
}
type XGBoostSchemaTreeParam struct {
NumFeature string `json:"num_feature"`
NumNodes string `json:"num_nodes"`
}