예제 #1
0
    def __init__(self,
                 dataset,
                 scoring,
                 model=None,
                 fit_params=None,
                 cv=4,
                 n_jobs=None):

        self.fit_params = fit_params if fit_params else dict()
        if model is None:
            model, dataset.df, categoricals, dataset.y = infer_model(
                dataset.df, dataset.features, dataset.y, n_jobs)
            self.fit_params["categorical_feature"] = categoricals
            n_jobs = 1

        self.model = model
        self.dataset = dataset
        self.scoring = scoring
        self.cv = cv
        self.n_jobs = n_jobs
        if self.n_jobs is not None and self.n_jobs > 1:
            warning_str = (
                "Warning: If your model is multithreaded, please initialise the number"
                "of jobs of LOFO to be equal to 1, otherwise you may experience performance issues."
            )
            warnings.warn(warning_str)
    def __init__(self,
                 df,
                 features,
                 target,
                 scoring,
                 model=None,
                 cv=4,
                 n_jobs=None):

        df = df.copy()
        self.fit_params = {}
        if model is None:
            model, df, categoricals = infer_model(df, features, target, n_jobs)
            self.fit_params["categorical_feature"] = categoricals
            n_jobs = 1

        self.model = model
        self.df = df
        self.features = features
        self.target = target
        self.scoring = scoring
        self.cv = cv
        self.n_jobs = n_jobs
        if self.n_jobs is not None and self.n_jobs > 1:
            warning_str = "Warning: If your model is multithreaded, please initialise the number \
                of jobs of LOFO to be equal to 1, otherwise you may experience issues."

            warnings.warn(warning_str)