important change to regrank interface, need some more test

This commit is contained in:
tqchen
2014-05-03 14:20:27 -07:00
parent 2305ea7af7
commit aab1b0e7b3
8 changed files with 223 additions and 145 deletions

View File

@@ -2,7 +2,7 @@
import ctypes
# load in xgboost library
#xglib = ctypes.cdll.LoadLibrary('./libxgboostpy.so')
xglib = ctypes.cdll.LoadLibrary('./libxgboostpy.so')
# entry type of sparse matrix
class REntry(ctypes.Structure):
@@ -10,6 +10,13 @@ class REntry(ctypes.Structure):
class DMatrix:
def __init__(fname = None):
self.__handle = xglib.
def __init__(self,fname = None):
self.__handle = xglib.XGDMatrixCreate();
if fname != None:
xglib.XGDMatrixLoad(self.__handle, ctypes.c_char_p(fname), 0)
def __del__(self):
xglib.XGDMatrixFree(self.__handle)
dmata = DMatrix('xx.buffer')