Class AbstractStratification

    • Constructor Detail

      • AbstractStratification

        public AbstractStratification()
    • Method Detail

      • check

        protected <T> String check​(List<Binnable<T>> data,
                                   int folds)
        Check method before performing stratification.
        Parameters:
        data - the data to check
        Returns:
        null if checks passed, otherwise error message
      • doStratify

        protected abstract <T> List<Binnable<T>> doStratify​(List<Binnable<T>> data,
                                                            int folds)
        Stratifies the data.
        Type Parameters:
        T - the payload type
        Parameters:
        data - the data to stratify
        folds - the number of folds
        Returns:
        the stratified data
      • stratify

        public <T> List<Binnable<T>> stratify​(List<Binnable<T>> data,
                                              int folds)
        Stratifies the data.
        Specified by:
        stratify in interface Stratification
        Type Parameters:
        T - the payload type
        Parameters:
        data - the data to stratify
        folds - the number of folds
        Returns:
        the stratified data
        Throws:
        IllegalStateException - if checks fail