question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using `cross_val_predict` with `RepeatedKFold`

See original GitHub issue

It would be nice to use RepeatedKFold with with cross_val_predict. It’s possible use cross_val_score with repeated K folds, but a ValueError is thrown with predict

model = LogisticRegression()
rkf = RepeatedKFold(n_splits=10, n_repeats=10)
prediction = cross_val_predict(model, X, y, cv=rkf)
score = cross_val_score(model, X, y, cv=rkf)

Throws ValueError: cross_val_predict only works for partitions.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
jnothmancommented, Jan 16, 2020

What do you think it should return???

7reactions
Carbinercommented, Oct 26, 2021

Just came across this, and would appreciate this feature. My use case is determining if certain observations we have are consistently mislabeled across different classifiers and different splits, to help determine what data we should be collecting and focusing on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - RepeatedKFold & cross_val_predict - Stack Overflow
cross_val_predict will provide for each of your samples one prediction value, however with RepeatedKFold for each sample multiple ...
Read more >
3.1. Cross-validation: evaluating estimator performance
Here is a flowchart of typical cross validation workflow in model training. ... The result of cross_val_predict may be different from those obtained...
Read more >
Repeated k-Fold Cross-Validation for Model Evaluation in ...
This involves simply repeating the cross-validation procedure multiple times and reporting the mean result across all folds from all runs.
Read more >
Addressing Overconfidence: Repeated K-Fold CV - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from ... StratifiedKFold, cross_val_score, cross_val_predict from sklearn import ...
Read more >
sklearn.model_selection.cross_val_predict() - W3cubDocs
Possible inputs for cv are: None, to use the default 3-fold cross validation,; integer, to specify the number of folds in a (Stratified)KFold ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found