Group K-fold partitioning a dataset
The scikit-learn package in Python has a <http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GroupKFold.html Group K-Fold> function that allows you to split the data-set into test/train folds while ensuring the same "group" is not present in different folds.
This is useful for example in studies where the same subject/person generates multiple data-points and we want to make sure the samples/data-points belonging to the same subject don’t appear in both the training and testing folds.
I was wondering if MATLAB has a way to do this or enable this option in <https://www.mathworks.com/help/stats/cvpartition.html cvpartition> function or in some other way. The default options only seem to preserve relative class-sizes.The scikit-learn package in Python has a <http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GroupKFold.html Group K-Fold> function that allows you to split the data-set into test/train folds while ensuring the same "group" is not present in different folds.
This is useful for example in studies where the same subject/person generates multiple data-points and we want to make sure the samples/data-points belonging to the same subject don’t appear in both the training and testing folds.
I was wondering if MATLAB has a way to do this or enable this option in <https://www.mathworks.com/help/stats/cvpartition.html cvpartition> function or in some other way. The default options only seem to preserve relative class-sizes. The scikit-learn package in Python has a <http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GroupKFold.html Group K-Fold> function that allows you to split the data-set into test/train folds while ensuring the same "group" is not present in different folds.
This is useful for example in studies where the same subject/person generates multiple data-points and we want to make sure the samples/data-points belonging to the same subject don’t appear in both the training and testing folds.
I was wondering if MATLAB has a way to do this or enable this option in <https://www.mathworks.com/help/stats/cvpartition.html cvpartition> function or in some other way. The default options only seem to preserve relative class-sizes. classification, machine learning, cvpartition MATLAB Answers — New Questions