INNER CODE UNIT · Python

test_id

fabsig/GPBoost · python-package/gpboost/engine.py:463

            test_id = [randidx[i: i + kstep] for i in range(0, num_data, kstep)]
            train_id = [np.concatenate([test_id[i] for i in range(nfold) if k != i]) for k in range(nfold)]
            folds = zip(train_id, test_id)
    ret = CVBooster()
    for train_idx, test_idx in folds:
        if np.max(train_idx) >= num_data or np.max(test_idx) >= num_data:
            raise ValueError("Index out of bound. "
                             "Maximum index in train_idx and test_idx should be less than num_data ({})"
                             .format(num_data))
        if np.min(train_idx) < 0 or np.min(test_idx) < 0:
            raise ValueError("Index out of bound. "
                             "Minimum index in train_idx and test_idx should be greater than or equal to 0")
        train_set = full_data.subset(sorted(train_idx))
        if full_data.free_raw_data:
            valid_set = full_data.subset(sorted(test_idx))
        else:
            valid_set = full_data.subset(sorted(test_idx), reference=train_set)
        # run preprocessing on the data set if needed

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…