MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / load_from_file

Function load_from_file

tests/c_api_test/test_.py:64–80  ·  view source on GitHub ↗
(filename, reference)

Source from the content-addressed store, hash-verified

62
63
64def load_from_file(filename, reference):
65 ref = None
66 if reference is not None:
67 ref = reference
68 handle = ctypes.c_void_p()
69 LIB.LGBM_DatasetCreateFromFile(
70 c_str(filename),
71 c_str('max_bin=15'),
72 ref,
73 ctypes.byref(handle))
74 print(LIB.LGBM_GetLastError())
75 num_data = ctypes.c_long()
76 LIB.LGBM_DatasetGetNumData(handle, ctypes.byref(num_data))
77 num_feature = ctypes.c_long()
78 LIB.LGBM_DatasetGetNumFeature(handle, ctypes.byref(num_feature))
79 print('#data: %d #feature: %d' % (num_data.value, num_feature.value))
80 return handle
81
82
83def save_to_binary(handle, filename):

Callers 1

test_datasetFunction · 0.85

Calls 1

c_strFunction · 0.70

Tested by

no test coverage detected