Class CrossValidationPartitioner<E>
Provides access to training and test partitions for n-fold cross validation.
Cross validation is used to evaluate the performance of a classifier when only training data is available. The training set is split into n parts and the training / evaluation is performed n times on these parts. The training partition always consists of n -1 parts and one part is used for testing.
To use the CrossValidationPartitioner<E> a client iterates over the n
CrossValidationPartitioner<E>.TrainingSampleStreams. Each
CrossValidationPartitioner<E>.TrainingSampleStream represents
one partition and is used first for training and afterwards for testing.
The TestSampleStream can be obtained from the
CrossValidationPartitioner<E>.TrainingSampleStream
with the GetTestSampleStream() method.
public class CrossValidationPartitioner<E> where E : class
Type Parameters
E
- Inheritance
-
CrossValidationPartitioner<E>
- Inherited Members
Constructors
CrossValidationPartitioner(IObjectStream<E?>, int)
Initializes the current instance.
public CrossValidationPartitioner(IObjectStream<E?> inElements, int numberOfPartitions)
Parameters
inElementsIObjectStream<E>numberOfPartitionsint
CrossValidationPartitioner(ICollection<E>, int)
Initializes the current instance.
public CrossValidationPartitioner(ICollection<E> elements, int numberOfPartitions)
Parameters
elementsICollection<E>numberOfPartitionsint
Properties
HasNext
Checks if there are more partitions available.
public bool HasNext { get; }
Property Value
Methods
Next()
Retrieves the next training and test partitions.
public CrossValidationPartitioner<E>.TrainingSampleStream Next()
Returns
Exceptions
- IOException
if there is an error during resetting the stream
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.