Use `UpdateAllowUnknown' for non-model related parameter. (#4961)
* Use `UpdateAllowUnknown' for non-model related parameter. Model parameter can not pack an additional boolean value due to binary IO format. This commit deals only with non-model related parameter configuration. * Add tidy command line arg for use-dmlc-gtest.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* This plugin defines the additional metric function.
|
||||
*/
|
||||
#include <xgboost/base.h>
|
||||
#include <dmlc/parameter.h>
|
||||
#include <xgboost/parameter.h>
|
||||
#include <xgboost/objective.h>
|
||||
#include <xgboost/json.h>
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace obj {
|
||||
// You do not have to use it.
|
||||
// see http://dmlc-core.readthedocs.org/en/latest/parameter.html
|
||||
// for introduction of this module.
|
||||
struct MyLogisticParam : public dmlc::Parameter<MyLogisticParam> {
|
||||
struct MyLogisticParam : public XGBoostParameter<MyLogisticParam> {
|
||||
float scale_neg_weight;
|
||||
// declare parameters
|
||||
DMLC_DECLARE_PARAMETER(MyLogisticParam) {
|
||||
@@ -32,7 +32,7 @@ DMLC_REGISTER_PARAMETER(MyLogisticParam);
|
||||
class MyLogistic : public ObjFunction {
|
||||
public:
|
||||
void Configure(const std::vector<std::pair<std::string, std::string> >& args) override {
|
||||
param_.InitAllowUnknown(args);
|
||||
param_.UpdateAllowUnknown(args);
|
||||
}
|
||||
void GetGradient(const HostDeviceVector<bst_float> &preds,
|
||||
const MetaInfo &info,
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
* \file sparse_page_lz4_format.cc
|
||||
* XGBoost Plugin to enable LZ4 compressed format on the external memory pages.
|
||||
*/
|
||||
#include <dmlc/registry.h>
|
||||
|
||||
#include <xgboost/data.h>
|
||||
#include <xgboost/logging.h>
|
||||
#include <dmlc/registry.h>
|
||||
#include <dmlc/parameter.h>
|
||||
#include <xgboost/parameter.h>
|
||||
#include <lz4.h>
|
||||
#include <lz4hc.h>
|
||||
#include "../../src/data/sparse_page_writer.h"
|
||||
|
||||
Reference in New Issue
Block a user