def __init__(self,
                 n_estimators=100,
                 max_depth=float('inf'),
                 min_samples_split=5,
                 ratio_features=.66,
                 compute_importances=False,
                 fit_optimal_depth=False,
                 build_to_opt_depth=False,
                 pruning='err',
                 min_depth=0,
                 update_delta=False,
                 optimize_memory_use=True,
                 oob_score=False,
                 tc=None,
                 random_state=None,
                 kernel='data',
                 delta=None,
                 subsampling=True,
                 sampsize=.5,
                 verbose=0,
                 max_nodes=float('inf'),
                 cpp_fit=True,
                 cpp_predict=True):
        '''
        A linear mixed forest.
        A linear mixed forest is a meta estimator derived from the random forest
        that fits a number of linear mixed decision trees on various sub-samples
        of the data set and uses averaging
        to improve the predictive accuracy and control over-fitting.

        Parameters
        ----------

        kernel: accepts either
            (1) positive definite matrix of size n x n, describing a dependency
                structure between the n samples (e.g. population structure).
            (2) strings 'data' or 'iid'
            If set to 'data' dependency structure is estimated from the
            predictor matrix X, if set to 'iid' i.i.d. samples are assumed
            and the linear mixed forest behaves like the random forest.

        n_estimators : integer, optional (default=100)
            The number of trees in the forest.

        ratio_features : fraction of the total number of features used for each
                         split (default=0.66)

        max_depth : optional (default='inf') real value that defining the
                    maximum depth of the tree.

        min_samples_split : integer, optional (default=5)
            The minimum number of samples required to split a node.

        fit_opt_depth: uses the forest likelihood to fit the optimal depth of
                       the trees in the ensemble on the out of bag samples
                       (default=False)

        build_to_opt_depth: stops furthering trees in the ensemble if
                            improvement of forest likelihood stops
                            (default=False). This helps to improve runtime
                            and to avoid overfitting when a relatively small
                            number of trees is used on a big dataset.

        sampsize: The number of samples drawn without replacement for growing a
                  single tree (default=0.5)

        subsampling: If 'True' this toggles sampling without replacement.
                     Otherwise as sampling without replacement is used
                     (default=True)

        verbose : int, optional (default=0) Controls the verbosity level of the
                  tree building process.
        '''
        self.init_parameters = locals()
        self.init_parameters.pop('self')
        self.n_estimators = n_estimators
        self.max_depth = max_depth
        self.min_samples_split = min_samples_split
        self.random_state = random_state
        self.kernel = kernel
        self.delta = delta
        self.update_delta = update_delta
        self.compute_importances = compute_importances
        self.fit_optimal_depth = fit_optimal_depth
        self.build_to_opt_depth = build_to_opt_depth
        self.optimize_memory_use = optimize_memory_use
        self.oob_error = None
        self.var_used = None
        self.log_importance = None
        self.ratio_features = ratio_features
        self.subsampling = subsampling
        self.sampsize = sampsize
        self.verbose = verbose
        self.depth = 0
        self.opt_depth = None
        self.pruning = pruning
        self.min_oob_error = float('inf')
        self.opt_delta = None
        self.fixed_effect = None
        self.tc = tc
        self.max_nodes = max_nodes
        self.cpp_fit = cpp_fit
        self.cpp_predict = cpp_predict
        self.min_depth = min_depth

        # Settings for (re)initialization#
        self.X = None
        self.y = None
        self.n = None
        self.m = None
        self.BLUP = None
        self.max_features = None
        self.var_used = None
        self.log_importance = None
        self.trees = []

        if random_state is not None:
            SP.random.seed(random_state)
        if tc is not None:
            parMixedForest.par_init(**self.init_parameters)
def __init__ ( self , n_estimators = 100 , max_depth = float ( 'inf' ) , min_samples_split = 5 , ratio_features = .66 , compute_importances = False , fit_optimal_depth = False , build_to_opt_depth = False , pruning = 'err' , min_depth = 0 , update_delta = False , optimize_memory_use = True , oob_score = False , tc = None , random_state = None , kernel = 'data' , delta = None , subsampling = True , sampsize = .5 , verbose = 0 , max_nodes = float ( 'inf' ) , cpp_fit = True , cpp_predict = True ) : self . init_parameters = locals ( ) self . init_parameters . pop ( 'self' ) self . n_estimators = n_estimators self . max_depth = max_depth self . min_samples_split = min_samples_split self . random_state = random_state self . kernel = kernel self . delta = delta self . update_delta = update_delta self . compute_importances = compute_importances self . fit_optimal_depth = fit_optimal_depth self . build_to_opt_depth = build_to_opt_depth self . optimize_memory_use = optimize_memory_use self . oob_error = None self . var_used = None self . log_importance = None self . ratio_features = ratio_features self . subsampling = subsampling self . sampsize = sampsize self . verbose = verbose self . depth = 0 self . opt_depth = None self . pruning = pruning self . min_oob_error = float ( 'inf' ) self . opt_delta = None self . fixed_effect = None self . tc = tc self . max_nodes = max_nodes self . cpp_fit = cpp_fit self . cpp_predict = cpp_predict self . min_depth = min_depth self . X = None self . y = None self . n = None self . m = None self . BLUP = None self . max_features = None self . var_used = None self . log_importance = None self . trees = [ ] if random_state is not None : SP . random . seed ( random_state ) if tc is not None : parMixedForest . par_init ( ** self . init_parameters )
A linear mixed forest.
        A linear mixed forest is a meta estimator derived from the random forest
        that fits a number of linear mixed decision trees on various sub-samples
        of the data set and uses averaging
        to improve the predictive accuracy and control over-fitting.

        Parameters
        ----------

        kernel: accepts either
            (1) positive definite matrix of size n x n, describing a dependency
                structure between the n samples (e.g. population structure).
            (2) strings 'data' or 'iid'
            If set to 'data' dependency structure is estimated from the
            predictor matrix X, if set to 'iid' i.i.d. samples are assumed
            and the linear mixed forest behaves like the random forest.

        n_estimators : integer, optional (default=100)
            The number of trees in the forest.

        ratio_features : fraction of the total number of features used for each
                         split (default=0.66)

        max_depth : optional (default='inf') real value that defining the
                    maximum depth of the tree.

        min_samples_split : integer, optional (default=5)
            The minimum number of samples required to split a node.

        fit_opt_depth: uses the forest likelihood to fit the optimal depth of
                       the trees in the ensemble on the out of bag samples
                       (default=False)

        build_to_opt_depth: stops furthering trees in the ensemble if
                            improvement of forest likelihood stops
                            (default=False). This helps to improve runtime
                            and to avoid overfitting when a relatively small
                            number of trees is used on a big dataset.

        sampsize: The number of samples drawn without replacement for growing a
                  single tree (default=0.5)

        subsampling: If 'True' this toggles sampling without replacement.
                     Otherwise as sampling without replacement is used
                     (default=True)

        verbose : int, optional (default=0) Controls the verbosity level of the
                  tree building process.