[Breaking] Require format to be specified in input URI. (#9077)
Previously, we use `libsvm` as default when format is not specified. However, the dmlc data parser is not particularly robust against errors, and the most common type of error is undefined format. Along with which, we will recommend users to use other data loader instead. We will continue the maintenance of the parsers as it's currently used for many internal tests including federated learning.
This commit is contained in:
@@ -88,8 +88,12 @@ class TestInteractionConstraints:
|
||||
def training_accuracy(self, tree_method):
|
||||
"""Test accuracy, reused by GPU tests."""
|
||||
from sklearn.metrics import accuracy_score
|
||||
dtrain = xgboost.DMatrix(dpath + 'agaricus.txt.train?indexing_mode=1')
|
||||
dtest = xgboost.DMatrix(dpath + 'agaricus.txt.test?indexing_mode=1')
|
||||
dtrain = xgboost.DMatrix(
|
||||
dpath + "agaricus.txt.train?indexing_mode=1&format=libsvm"
|
||||
)
|
||||
dtest = xgboost.DMatrix(
|
||||
dpath + "agaricus.txt.test?indexing_mode=1&format=libsvm"
|
||||
)
|
||||
params = {
|
||||
'eta': 1,
|
||||
'max_depth': 6,
|
||||
|
||||
Reference in New Issue
Block a user