Remove unused parameters. (#7499)
This commit is contained in:
parent
1864fab592
commit
01152f89ee
@ -47,8 +47,6 @@ struct TrainParam : public XGBoostParameter<TrainParam> {
|
|||||||
float reg_lambda;
|
float reg_lambda;
|
||||||
// L1 regularization factor
|
// L1 regularization factor
|
||||||
float reg_alpha;
|
float reg_alpha;
|
||||||
// default direction choice
|
|
||||||
int default_direction;
|
|
||||||
// maximum delta update we can add in weight estimation
|
// maximum delta update we can add in weight estimation
|
||||||
// this parameter can be used to stabilize update
|
// this parameter can be used to stabilize update
|
||||||
// default=0 means no constraint on weight delta
|
// default=0 means no constraint on weight delta
|
||||||
@ -77,22 +75,10 @@ struct TrainParam : public XGBoostParameter<TrainParam> {
|
|||||||
// Stored as a JSON string.
|
// Stored as a JSON string.
|
||||||
std::string interaction_constraints;
|
std::string interaction_constraints;
|
||||||
|
|
||||||
// the criteria to use for ranking splits
|
|
||||||
std::string split_evaluator;
|
|
||||||
|
|
||||||
// ------ From CPU quantile histogram -------.
|
// ------ From CPU quantile histogram -------.
|
||||||
// percentage threshold for treating a feature as sparse
|
// percentage threshold for treating a feature as sparse
|
||||||
// e.g. 0.2 indicates a feature with fewer than 20% nonzeros is considered sparse
|
// e.g. 0.2 indicates a feature with fewer than 20% nonzeros is considered sparse
|
||||||
double sparse_threshold;
|
double sparse_threshold;
|
||||||
// when grouping features, how many "conflicts" to allow.
|
|
||||||
// conflict is when an instance has nonzero values for two or more features
|
|
||||||
// default is 0, meaning features should be strictly complementary
|
|
||||||
double max_conflict_rate;
|
|
||||||
// when grouping features, how much effort to expend to prevent singleton groups
|
|
||||||
// we'll try to insert each feature into existing groups before creating a new group
|
|
||||||
// for that feature; to save time, only up to (max_search_group) of existing groups
|
|
||||||
// will be considered. If set to zero, ALL existing groups will be examined
|
|
||||||
unsigned max_search_group;
|
|
||||||
|
|
||||||
// declare the parameters
|
// declare the parameters
|
||||||
DMLC_DECLARE_PARAMETER(TrainParam) {
|
DMLC_DECLARE_PARAMETER(TrainParam) {
|
||||||
@ -139,12 +125,6 @@ struct TrainParam : public XGBoostParameter<TrainParam> {
|
|||||||
.set_lower_bound(0.0f)
|
.set_lower_bound(0.0f)
|
||||||
.set_default(0.0f)
|
.set_default(0.0f)
|
||||||
.describe("L1 regularization on leaf weight");
|
.describe("L1 regularization on leaf weight");
|
||||||
DMLC_DECLARE_FIELD(default_direction)
|
|
||||||
.set_default(0)
|
|
||||||
.add_enum("learn", 0)
|
|
||||||
.add_enum("left", 1)
|
|
||||||
.add_enum("right", 2)
|
|
||||||
.describe("Default direction choice when encountering a missing value");
|
|
||||||
DMLC_DECLARE_FIELD(max_delta_step)
|
DMLC_DECLARE_FIELD(max_delta_step)
|
||||||
.set_lower_bound(0.0f)
|
.set_lower_bound(0.0f)
|
||||||
.set_default(0.0f)
|
.set_default(0.0f)
|
||||||
@ -198,23 +178,10 @@ struct TrainParam : public XGBoostParameter<TrainParam> {
|
|||||||
"e.g. [[0, 1], [2, 3, 4]], where each inner list is a group of"
|
"e.g. [[0, 1], [2, 3, 4]], where each inner list is a group of"
|
||||||
"indices of features that are allowed to interact with each other."
|
"indices of features that are allowed to interact with each other."
|
||||||
"See tutorial for more information");
|
"See tutorial for more information");
|
||||||
DMLC_DECLARE_FIELD(split_evaluator)
|
|
||||||
.set_default("elastic_net,monotonic")
|
|
||||||
.describe("The criteria to use for ranking splits");
|
|
||||||
|
|
||||||
// ------ From cpu quantile histogram -------.
|
// ------ From cpu quantile histogram -------.
|
||||||
DMLC_DECLARE_FIELD(sparse_threshold).set_range(0, 1.0).set_default(0.2)
|
DMLC_DECLARE_FIELD(sparse_threshold).set_range(0, 1.0).set_default(0.2)
|
||||||
.describe("percentage threshold for treating a feature as sparse");
|
.describe("percentage threshold for treating a feature as sparse");
|
||||||
DMLC_DECLARE_FIELD(max_conflict_rate).set_range(0, 1.0).set_default(0)
|
|
||||||
.describe("when grouping features, how many \"conflicts\" to allow."
|
|
||||||
"conflict is when an instance has nonzero values for two or more features."
|
|
||||||
"default is 0, meaning features should be strictly complementary.");
|
|
||||||
DMLC_DECLARE_FIELD(max_search_group).set_lower_bound(0).set_default(100)
|
|
||||||
.describe("when grouping features, how much effort to expend to prevent "
|
|
||||||
"singleton groups. We'll try to insert each feature into existing "
|
|
||||||
"groups before creating a new group for that feature; to save time, "
|
|
||||||
"only up to (max_search_group) of existing groups will be "
|
|
||||||
"considered. If set to zero, ALL existing groups will be examined.");
|
|
||||||
|
|
||||||
// add alias of parameters
|
// add alias of parameters
|
||||||
DMLC_DECLARE_ALIAS(reg_lambda, lambda);
|
DMLC_DECLARE_ALIAS(reg_lambda, lambda);
|
||||||
|
|||||||
@ -27,24 +27,29 @@ DMLC_REGISTRY_FILE_TAG(updater_colmaker);
|
|||||||
struct ColMakerTrainParam : XGBoostParameter<ColMakerTrainParam> {
|
struct ColMakerTrainParam : XGBoostParameter<ColMakerTrainParam> {
|
||||||
// speed optimization for dense column
|
// speed optimization for dense column
|
||||||
float opt_dense_col;
|
float opt_dense_col;
|
||||||
|
// default direction choice
|
||||||
|
int default_direction;
|
||||||
|
|
||||||
DMLC_DECLARE_PARAMETER(ColMakerTrainParam) {
|
DMLC_DECLARE_PARAMETER(ColMakerTrainParam) {
|
||||||
DMLC_DECLARE_FIELD(opt_dense_col)
|
DMLC_DECLARE_FIELD(opt_dense_col)
|
||||||
.set_range(0.0f, 1.0f)
|
.set_range(0.0f, 1.0f)
|
||||||
.set_default(1.0f)
|
.set_default(1.0f)
|
||||||
.describe("EXP Param: speed optimization for dense column.");
|
.describe("EXP Param: speed optimization for dense column.");
|
||||||
|
DMLC_DECLARE_FIELD(default_direction)
|
||||||
|
.set_default(0)
|
||||||
|
.add_enum("learn", 0)
|
||||||
|
.add_enum("left", 1)
|
||||||
|
.add_enum("right", 2)
|
||||||
|
.describe("Default direction choice when encountering a missing value");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief whether need forward small to big search: default right */
|
/*! \brief whether need forward small to big search: default right */
|
||||||
inline bool NeedForwardSearch(int default_direction, float col_density,
|
inline bool NeedForwardSearch(float col_density, bool indicator) const {
|
||||||
bool indicator) const {
|
|
||||||
return default_direction == 2 ||
|
return default_direction == 2 ||
|
||||||
(default_direction == 0 && (col_density < opt_dense_col) &&
|
(default_direction == 0 && (col_density < opt_dense_col) && !indicator);
|
||||||
!indicator);
|
|
||||||
}
|
}
|
||||||
/*! \brief whether need backward big to small search: default left */
|
/*! \brief whether need backward big to small search: default left */
|
||||||
inline bool NeedBackwardSearch(int default_direction) const {
|
inline bool NeedBackwardSearch() const { return default_direction != 2; }
|
||||||
return default_direction != 2;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DMLC_REGISTER_PARAMETER(ColMakerTrainParam);
|
DMLC_REGISTER_PARAMETER(ColMakerTrainParam);
|
||||||
@ -465,15 +470,13 @@ class ColMaker: public TreeUpdater {
|
|||||||
auto c = page[fid];
|
auto c = page[fid];
|
||||||
const bool ind =
|
const bool ind =
|
||||||
c.size() != 0 && c[0].fvalue == c[c.size() - 1].fvalue;
|
c.size() != 0 && c[0].fvalue == c[c.size() - 1].fvalue;
|
||||||
if (colmaker_train_param_.NeedForwardSearch(
|
if (colmaker_train_param_.NeedForwardSearch(column_densities_[fid], ind)) {
|
||||||
param_.default_direction, column_densities_[fid], ind)) {
|
this->EnumerateSplit(c.data(), c.data() + c.size(), +1, fid, gpair, stemp_[tid],
|
||||||
this->EnumerateSplit(c.data(), c.data() + c.size(), +1, fid,
|
evaluator);
|
||||||
gpair, stemp_[tid], evaluator);
|
|
||||||
}
|
}
|
||||||
if (colmaker_train_param_.NeedBackwardSearch(
|
if (colmaker_train_param_.NeedBackwardSearch()) {
|
||||||
param_.default_direction)) {
|
this->EnumerateSplit(c.data() + c.size() - 1, c.data() - 1, -1, fid, gpair,
|
||||||
this->EnumerateSplit(c.data() + c.size() - 1, c.data() - 1, -1,
|
stemp_[tid], evaluator);
|
||||||
fid, gpair, stemp_[tid], evaluator);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user