def __init__(self, params=None, cache=(), model_file=None):
        # pylint: disable=invalid-name
        """Initialize the Booster.

        Parameters
        ----------
        params : dict
            Parameters for boosters.
        cache : list
            List of cache items.
        model_file : string
            Path to the model file.
        """
        for d in cache:
            if not isinstance(d, DMatrix):
                raise TypeError('invalid cache item: {}'.format(type(d).__name__))
            self._validate_features(d)

        dmats = c_array(ctypes.c_void_p, [d.handle for d in cache])
        self.handle = ctypes.c_void_p()
        _check_call(_LIB.XGBoosterCreate(dmats, len(cache), ctypes.byref(self.handle)))
        self.set_param({'seed': 0})
        self.set_param(params or {})
        if model_file is not None:
            self.load_model(model_file)
def __init__ ( self , params = None , cache = ( ) , model_file = None ) : for d in cache : if not isinstance ( d , DMatrix ) : raise TypeError ( 'invalid cache item: {}' . format ( type ( d ) . __name__ ) ) self . _validate_features ( d ) dmats = c_array ( ctypes . c_void_p , [ d . handle for d in cache ] ) self . handle = ctypes . c_void_p ( ) _check_call ( _LIB . XGBoosterCreate ( dmats , len ( cache ) , ctypes . byref ( self . handle ) ) ) self . set_param ( { 'seed' : 0 } ) self . set_param ( params or { } ) if model_file is not None : self . load_model ( model_file )
Initialize the Booster.

        Parameters
        ----------
        params : dict
            Parameters for boosters.
        cache : list
            List of cache items.
        model_file : string
            Path to the model file.