com.rapidminer.example.set
Class StratifiedPartitionBuilder

java.lang.Object
  extended by com.rapidminer.example.set.StratifiedPartitionBuilder
All Implemented Interfaces:
PartitionBuilder

public class StratifiedPartitionBuilder
extends java.lang.Object
implements PartitionBuilder

Creates a shuffled and stratified partition for an example set. The example set must have an nominal label. This partition builder can work in two modes:

  1. The first working mode is automatically used for generic types of ratio arrays, especially for those with different sizes. Due to to this fact it however cannot longer be guaranteed that each fold exactly contains the correct number of examples and each class at least once.
  2. In contrast to the first mode the correct partition can at least be guaranteed for ratio arrays containing the same ratio value for all folds. The second mode is automatically performed in this case (e.g. for cross validation).
  3. Author:
    Ingo Mierswa ingomierswa Exp $

    Constructor Summary
    StratifiedPartitionBuilder(ExampleSet exampleSet, int seed)
               
     
    Method Summary
     int[] createPartition(double[] ratio, int size)
              Returns a stratified partition for the given example set.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    StratifiedPartitionBuilder

    public StratifiedPartitionBuilder(ExampleSet exampleSet,
                                      int seed)
    Method Detail

    createPartition

    public int[] createPartition(double[] ratio,
                                 int size)
    Returns a stratified partition for the given example set. The examples must have an nominal label.

    Specified by:
    createPartition in interface PartitionBuilder


    Copyright © 2001-2009 by Rapid-I