aliases.R 3.37 KB
Newer Older
1
2
3
# Central location for parameter aliases.
# See https://lightgbm.readthedocs.io/en/latest/Parameters.html#core-parameters

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# [description] List of respected parameter aliases specific to lgb.Dataset. Wrapped in a function to
#               take advantage of lazy evaluation (so it doesn't matter what order
#               R sources files during installation).
# [return] A named list, where each key is a parameter relevant to lgb.DataSet and each value is a character
#          vector of corresponding aliases.
.DATASET_PARAMETERS <- function() {
    return(list(
        "bin_construct_sample_cnt" = c(
            "bin_construct_sample_cnt"
            , "subsample_for_bin"
        )
        , "categorical_feature" = c(
            "categorical_feature"
            , "cat_feature"
            , "categorical_column"
            , "cat_column"
        )
21
22
23
        , "data_random_seed" = c(
            "data_random_seed"
            , "data_seed"
24
25
26
        )
        , "enable_bundle" = c(
            "enable_bundle"
27
            , "is_enable_bundle"
28
29
30
31
32
33
            , "bundle"
        )
        , "feature_pre_filter" = "feature_pre_filter"
        , "forcedbins_filename" = "forcedbins_filename"
        , "group_column" = c(
            "group_column"
34
            , "group"
35
36
37
38
39
40
41
42
43
44
45
46
47
48
            , "group_id"
            , "query_column"
            , "query"
            , "query_id"
        )
        , "header" = c(
            "header"
            , "has_header"
        )
        , "ignore_column" = c(
            "ignore_column"
            , "ignore_feature"
            , "blacklist"
        )
49
50
51
52
53
54
        , "is_enable_sparse" = c(
            "is_enable_sparse"
            , "is_sparse"
            , "enable_sparse"
            , "sparse"
        )
55
56
57
58
59
60
        , "label_column" = c(
            "label_column"
            , "label"
        )
        , "max_bin" = "max_bin"
        , "max_bin_by_feature" = "max_bin_by_feature"
61
        , "min_data_in_bin" = "min_data_in_bin"
62
        , "pre_partition" = c(
63
            "pre_partition"
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
            , "is_pre_partition"
        )
        , "two_round" = c(
            "two_round"
            , "two_round_loading"
            , "use_two_round_loading"
        )
        , "use_missing" = "use_missing"
        , "weight_column" = c(
            "weight_column"
            , "weight"
        )
        , "zero_as_missing" = "zero_as_missing"
    ))
}

80
81
82
83
# [description] List of respected parameter aliases. Wrapped in a function to take advantage of
#               lazy evaluation (so it doesn't matter what order R sources files during installation).
# [return] A named list, where each key is a main LightGBM parameter and each value is a character
#          vector of corresponding aliases.
84
.PARAMETER_ALIASES <- function() {
85
    learning_params <- list(
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
        "boosting" = c(
            "boosting"
            , "boost"
            , "boosting_type"
        )
        , "early_stopping_round" = c(
            "early_stopping_round"
            , "early_stopping_rounds"
            , "early_stopping"
            , "n_iter_no_change"
        )
        , "num_iterations" = c(
            "num_iterations"
            , "num_iteration"
            , "n_iter"
            , "num_tree"
            , "num_trees"
            , "num_round"
            , "num_rounds"
            , "num_boost_round"
            , "n_estimators"
        )
108
109
    )
    return(c(learning_params, .DATASET_PARAMETERS()))
110
}