Skip to content

Custom cross validator #12

@jmrichardson

Description

@jmrichardson

Hi, I am trying to send a custom sklearn compatible CV splitter and it appears that the code in PyImpetus is just defaulting to KFold:

# for a value of 0, no CV is applied
        if self.cv!= 0:
 ...
            else:
                kfold = KFold(n_splits=self.cv, random_state=self.random_state, shuffle=True)
                if self.verbose > 0:
                    with tqdm_joblib(tqdm(desc="Progress bar", total=self.cv)) as progress_bar:
                        tmp = parallel(delayed(self._find_MB)(data.iloc[train].copy(), Y[train]) for train, test in kfold.split(data))
                else:
                    tmp = parallel(delayed(self._find_MB)(data.iloc[train].copy(), Y[train]) for train, test in kfold.split(data))

Instead, I was expecting PyImpetus should just use the cv splitter from cv argument:

# for a value of 0, no CV is applied
        if self.cv!= 0:
 ...
            else:
                if self.verbose > 0:
                    with tqdm_joblib(tqdm(desc="Progress bar", total=self.cv)) as progress_bar:
                        tmp = parallel(delayed(self._find_MB)(data.iloc[train].copy(), Y[train]) for train, test in self.cv.split(data))
                else:
                    tmp = parallel(delayed(self._find_MB)(data.iloc[train].copy(), Y[train]) for train, test in self.cv.split(data))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions