Disable parameter validation for Scikit-Learn interface. (#5167)
* Disable parameter validation for now. Scikit-Learn passes all parameters down to XGBoost, whether they are used or not. * Add option `validate_parameters`.
This commit is contained in:
@@ -30,8 +30,6 @@ TEST(Monitor, Logging) {
|
||||
run_monitor();
|
||||
output = testing::internal::GetCapturedStderr();
|
||||
ASSERT_EQ(output.size(), 0);
|
||||
|
||||
ConsoleLogger::Configure(Args{{"verbosity", "1"}});
|
||||
}
|
||||
} // namespace common
|
||||
} // namespace xgboost
|
||||
|
||||
@@ -31,12 +31,14 @@ TEST(Learner, Basic) {
|
||||
}
|
||||
|
||||
TEST(Learner, ParameterValidation) {
|
||||
ConsoleLogger::Configure({{"verbosity", "2"}});
|
||||
size_t constexpr kRows = 1;
|
||||
size_t constexpr kCols = 1;
|
||||
auto pp_mat = CreateDMatrix(kRows, kCols, 0);
|
||||
auto& p_mat = *pp_mat;
|
||||
|
||||
auto learner = std::unique_ptr<Learner>(Learner::Create({p_mat}));
|
||||
learner->SetParam("validate_parameters", "1");
|
||||
learner->SetParam("Knock Knock", "Who's there?");
|
||||
learner->SetParam("Silence", "....");
|
||||
learner->SetParam("tree_method", "exact");
|
||||
@@ -45,7 +47,7 @@ TEST(Learner, ParameterValidation) {
|
||||
learner->Configure();
|
||||
std::string output = testing::internal::GetCapturedStderr();
|
||||
|
||||
ASSERT_TRUE(output.find("Parameters: { Knock Knock, Silence } are not used.") != std::string::npos);
|
||||
ASSERT_TRUE(output.find("Parameters: { Knock Knock, Silence }") != std::string::npos);
|
||||
delete pp_mat;
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ TEST_F(SerializationTest, ConfigurationCount) {
|
||||
}
|
||||
ASSERT_EQ(occureences, 2);
|
||||
|
||||
xgboost::ConsoleLogger::Configure({{"verbosity", "1"}});
|
||||
xgboost::ConsoleLogger::Configure({{"verbosity", "2"}});
|
||||
}
|
||||
|
||||
TEST_F(SerializationTest, GPU_CoordDescent) {
|
||||
|
||||
Reference in New Issue
Block a user