Class StratifiedCrossValidation
- java.lang.Object
-
- elki.evaluation.classification.holdout.AbstractHoldout
-
- elki.evaluation.classification.holdout.StratifiedCrossValidation
-
- All Implemented Interfaces:
Holdout
public class StratifiedCrossValidation extends AbstractHoldout
A stratified n-fold crossvalidation to distribute the data to n buckets where each bucket exhibits approximately the same distribution of classes as does the complete data set. The buckets are disjoint. The distribution is deterministic.- Since:
- 0.7.0
- Author:
- Arthur Zimek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StratifiedCrossValidation.Par
Parameterization class
-
Field Summary
Fields Modifier and Type Field Description protected int[]
assignment
Partition assignment, sizesprotected int
fold
Holds the number of folds, current fold.protected int
nfold
Holds the number of folds, current fold.protected int[]
sizes
Partition assignment, sizes-
Fields inherited from class elki.evaluation.classification.holdout.AbstractHoldout
bundle, labelcol, labels
-
-
Constructor Summary
Constructors Constructor Description StratifiedCrossValidation(int nfold)
Provides a stratified crossvalidation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(MultipleObjectsBundle bundle)
Initialize the holdout procedure for a data set.TrainingAndTestSet
nextPartitioning()
Get the next partitioning of the given holdout.int
numberOfPartitions()
How many partitions to test.-
Methods inherited from class elki.evaluation.classification.holdout.AbstractHoldout
allClassLabels, allClassLabels, findClassLabelColumn, getLabels
-
-
-
-
Method Detail
-
numberOfPartitions
public int numberOfPartitions()
Description copied from interface:Holdout
How many partitions to test.- Returns:
- Number of partitions.
-
initialize
public void initialize(MultipleObjectsBundle bundle)
Description copied from interface:Holdout
Initialize the holdout procedure for a data set.- Specified by:
initialize
in interfaceHoldout
- Overrides:
initialize
in classAbstractHoldout
- Parameters:
bundle
- Data set bundle
-
nextPartitioning
public TrainingAndTestSet nextPartitioning()
Description copied from interface:Holdout
Get the next partitioning of the given holdout.- Returns:
- Next partitioning of the data set
-
-