[DIST] Add Distributed XGBoost on AWS Tutorial

This commit is contained in:
tqchen
2016-02-25 20:42:16 -08:00
parent 61d9edcaa4
commit a71ba04109
11 changed files with 355 additions and 86 deletions

View File

@@ -880,11 +880,9 @@ class Booster(object):
fname : string or a memory buffer
Input file name or memory buffer(see also save_raw)
"""
if isinstance(fname, STRING_TYPES): # assume file name
if os.path.exists(fname):
_LIB.XGBoosterLoadModel(self.handle, c_str(fname))
else:
raise ValueError("No such file: {0}".format(fname))
if isinstance(fname, STRING_TYPES):
# assume file name, cannot use os.path.exist to check, file can be from URL.
_check_call(_LIB.XGBoosterLoadModel(self.handle, c_str(fname)))
else:
buf = fname
length = ctypes.c_ulong(len(buf))