Skip to content

Commit

Permalink
[dask] Allow empty data matrix in AFT survival
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Nov 12, 2020
1 parent d711d64 commit eb58239
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions src/metric/survival_metric.cu
Expand Up @@ -206,10 +206,6 @@ struct EvalEWiseSurvivalBase : public Metric {
bst_float Eval(const HostDeviceVector<bst_float>& preds,
const MetaInfo& info,
bool distributed) override {
CHECK_NE(info.labels_lower_bound_.Size(), 0U)
<< "labels_lower_bound cannot be empty";
CHECK_NE(info.labels_upper_bound_.Size(), 0U)
<< "labels_upper_bound cannot be empty";
CHECK_EQ(preds.Size(), info.labels_lower_bound_.Size());
CHECK_EQ(preds.Size(), info.labels_upper_bound_.Size());

Expand Down
3 changes: 1 addition & 2 deletions tests/python/test_with_dask.py
Expand Up @@ -594,7 +594,6 @@ def test_predict_with_meta(client):


def run_aft_survival(client, dmatrix_t):
# survival doesn't handle empty dataset well.
df = dd.read_csv(os.path.join(tm.PROJECT_ROOT, 'demo', 'data',
'veterans_lung_cancer.csv'))
y_lower_bound = df['Survival_label_lower_bound']
Expand Down Expand Up @@ -632,7 +631,7 @@ def run_aft_survival(client, dmatrix_t):


def test_aft_survival():
with LocalCluster(n_workers=1) as cluster:
with LocalCluster(n_workers=kWorkers) as cluster:
with Client(cluster) as client:
run_aft_survival(client, DaskDMatrix)

Expand Down

0 comments on commit eb58239

Please sign in to comment.