MCPcopy Create free account
hub / github.com/catboost/catboost / load_simple_dataset_as_lists

Function load_simple_dataset_as_lists

catboost/python-package/ut/medium/test.py:304–317  ·  view source on GitHub ↗
(is_test)

Source from the content-addressed store, hash-verified

302
303# returns (features_data, labels)
304def load_simple_dataset_as_lists(is_test):
305 features_data = []
306 labels = []
307 with open(TEST_FILE if is_test else TRAIN_FILE) as data_file:
308 for line in data_file:
309 elements = line[:-1].split('\t')
310 features_data.append([])
311 for column_idx, element in enumerate(elements):
312 if column_idx == TARGET_IDX:
313 labels.append(element)
314 else:
315 features_data[-1].append(element if column_idx in CAT_COLUMNS else float(element))
316
317 return features_data, labels
318
319
320# Test cases begin here ########################################################

Callers 2

test_load_listFunction · 0.85
test_no_cat_in_predictFunction · 0.85

Calls 4

openFunction · 0.50
floatFunction · 0.50
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected