Remove duplicated DMatrix. (#6592)

This commit is contained in:
Jiaming Yuan 2021-01-12 09:36:56 +08:00 committed by GitHub
parent c709f2aaaf
commit 03cd087da1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -653,12 +653,6 @@ class XGBModel(XGBModelBase):
save_best=True)]
"""
train_dmatrix = DMatrix(data=X, label=y, weight=sample_weight,
base_margin=base_margin,
missing=self.missing,
nthread=self.n_jobs)
train_dmatrix.set_info(feature_weights=feature_weights)
evals_result = {}
train_dmatrix, evals = self._wrap_evaluation_matrices(

View File

@ -112,8 +112,12 @@ class TestRanking:
Cleanup test artifacts from download and unpacking
:return:
"""
os.remove(cls.dpath + "MQ2008.zip")
shutil.rmtree(cls.dpath + "MQ2008")
zip_f = cls.dpath + "MQ2008.zip"
if os.path.exists(zip_f):
os.remove(zip_f)
directory = cls.dpath + "MQ2008"
if os.path.exists(directory):
shutil.rmtree(directory)
def test_training(self):
"""