Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added how-to guide: k-fold cross-validation #43

Merged
merged 7 commits into from
Oct 12, 2021

Conversation

LiviaCavalcanti
Copy link
Contributor

Resolves #28.
A how-to guide of training model with cross-validation using the k-fold technique to estimate its performance. For data split into the folds, the scikit-learn library was used.

"acc_sum = 0\n",
"for n_fold in range(len(results_per_fold)):\n",
" current_fold = results_per_fold[n_fold]\n",
" print(f\"Validation Results - Epoch[{n_fold + 1}] Avg accuracy: {current_fold[1][2]['Accuracy']:.2f} Avg loss: {current_fold[1][2]['Loss']:.2f}\")\n",
Copy link
Contributor

@sdesrozis sdesrozis Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current_fold[1][2]["Accuracy"] means getting the Accuracy score of the validation ([1]) at epoch 3 ([2]). Maybe it worth mention that.

@sdesrozis
Copy link
Contributor

@LiviaCavalcanti Thank you for this great contribution ! I left a few comments.

@vfdev-5
Copy link
Member

vfdev-5 commented Oct 7, 2021

@LiviaCavalcanti thanks a lot for the PR ! Looks good to me. Please fix the comments by @sdesrozis and it is good to go.

how-to-guides/07-cross-validation.ipynb Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
how-to-guides/07-cross-validation.ipynb Outdated Show resolved Hide resolved
@Priyansi
Copy link
Collaborator

Priyansi commented Oct 7, 2021

@LiviaCavalcanti thank you for this amazing PR! I've left some comments and this PR should be good to merge as soon as they are addressed.

@Priyansi Priyansi merged commit ba9b4e1 into pytorch-ignite:main Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross validation guide
4 participants