def __init__(self, model_file=None, booster_handle=None, pred_parameter=None):
        """Initialize the _InnerPredictor.

        Parameters
        ----------
        model_file : string or None, optional (default=None)
            Path to the model file.
        booster_handle : object or None, optional (default=None)
            Handle of Booster.
        pred_parameter: dict or None, optional (default=None)
            Other parameters for the prediciton.
        """
        self.handle = ctypes.c_void_p()
        self.__is_manage_handle = True
        if model_file is not None:
            """Prediction task"""
            out_num_iterations = ctypes.c_int(0)
            _safe_call(_LIB.LGBM_BoosterCreateFromModelfile(
                c_str(model_file),
                ctypes.byref(out_num_iterations),
                ctypes.byref(self.handle)))
            out_num_class = ctypes.c_int(0)
            _safe_call(_LIB.LGBM_BoosterGetNumClasses(
                self.handle,
                ctypes.byref(out_num_class)))
            self.num_class = out_num_class.value
            self.num_total_iteration = out_num_iterations.value
            self.pandas_categorical = _load_pandas_categorical(file_name=model_file)
        elif booster_handle is not None:
            self.__is_manage_handle = False
            self.handle = booster_handle
            out_num_class = ctypes.c_int(0)
            _safe_call(_LIB.LGBM_BoosterGetNumClasses(
                self.handle,
                ctypes.byref(out_num_class)))
            self.num_class = out_num_class.value
            out_num_iterations = ctypes.c_int(0)
            _safe_call(_LIB.LGBM_BoosterGetCurrentIteration(
                self.handle,
                ctypes.byref(out_num_iterations)))
            self.num_total_iteration = out_num_iterations.value
            self.pandas_categorical = None
        else:
            raise TypeError('Need model_file or booster_handle to create a predictor')

        pred_parameter = {} if pred_parameter is None else pred_parameter
        self.pred_parameter = param_dict_to_str(pred_parameter)
def __init__ ( self , model_file = None , booster_handle = None , pred_parameter = None ) : self . handle = ctypes . c_void_p ( ) self . __is_manage_handle = True if model_file is not None : out_num_iterations = ctypes . c_int ( 0 ) _safe_call ( _LIB . LGBM_BoosterCreateFromModelfile ( c_str ( model_file ) , ctypes . byref ( out_num_iterations ) , ctypes . byref ( self . handle ) ) ) out_num_class = ctypes . c_int ( 0 ) _safe_call ( _LIB . LGBM_BoosterGetNumClasses ( self . handle , ctypes . byref ( out_num_class ) ) ) self . num_class = out_num_class . value self . num_total_iteration = out_num_iterations . value self . pandas_categorical = _load_pandas_categorical ( file_name = model_file ) elif booster_handle is not None : self . __is_manage_handle = False self . handle = booster_handle out_num_class = ctypes . c_int ( 0 ) _safe_call ( _LIB . LGBM_BoosterGetNumClasses ( self . handle , ctypes . byref ( out_num_class ) ) ) self . num_class = out_num_class . value out_num_iterations = ctypes . c_int ( 0 ) _safe_call ( _LIB . LGBM_BoosterGetCurrentIteration ( self . handle , ctypes . byref ( out_num_iterations ) ) ) self . num_total_iteration = out_num_iterations . value self . pandas_categorical = None else : raise TypeError ( 'Need model_file or booster_handle to create a predictor' ) pred_parameter = { } if pred_parameter is None else pred_parameter self . pred_parameter = param_dict_to_str ( pred_parameter )
Initialize the _InnerPredictor.

        Parameters
        ----------
        model_file : string or None, optional (default=None)
            Path to the model file.
        booster_handle : object or None, optional (default=None)
            Handle of Booster.
        pred_parameter: dict or None, optional (default=None)
            Other parameters for the prediciton.