Skip to content

Commit 9ffb6ff

Browse files
authored
Drop the deprecated binary model for gblinear. (#11553)
1 parent 14eb445 commit 9ffb6ff

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

src/gbm/gblinear.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ class GBLinear : public GradientBooster {
104104

105105
bool ModelFitted() const override { return BoostedRounds() != 0; }
106106

107-
void Load(dmlc::Stream* fi) override {
108-
model_.Load(fi);
107+
void Load(dmlc::Stream*) override {
108+
LOG(FATAL) << "The deprecated binary model has been removed";
109109
}
110-
void Save(dmlc::Stream* fo) const override {
111-
model_.Save(fo);
110+
void Save(dmlc::Stream*) const override {
111+
LOG(FATAL) << "The deprecated binary model has been removed";
112112
}
113113

114114
void SaveModel(Json* p_out) const override {

src/gbm/gblinear_model.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/*!
2-
* Copyright 2018-2019 by Contributors
1+
/**
2+
* Copyright 2018-2025, XGBoost Contributors
33
*/
44
#pragma once
55
#include <dmlc/io.h>
@@ -71,17 +71,6 @@ class GBLinearModel : public Model {
7171
void SaveModel(Json *p_out) const override;
7272
void LoadModel(Json const &in) override;
7373

74-
// save the model to file
75-
void Save(dmlc::Stream *fo) const {
76-
fo->Write(&param_, sizeof(param_));
77-
fo->Write(weight);
78-
}
79-
// load model from file
80-
void Load(dmlc::Stream *fi) {
81-
CHECK_EQ(fi->Read(&param_, sizeof(param_)), sizeof(param_));
82-
fi->Read(&weight);
83-
}
84-
8574
// model bias
8675
inline bst_float *Bias() {
8776
return &weight[learner_model_param->num_feature *

0 commit comments

Comments
 (0)