Class RandomSampler

java.lang.Object
edu.cmu.tetrad.data.RandomSampler

public final class RandomSampler extends Object
Provides a static method for sampling without replacement from a dataset to create a new dataset with a sample size supplied by the user.
Version:
$Id: $Id
Author:
Frank Wimberly
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new instance of the RandomSampler.
  • Method Summary

    Modifier and Type
    Method
    Description
    static DataSet
    sample(DataSet dataSet, int newSampleSize)
    This method takes a dataset and a sample size and creates a new dataset containing that number of samples by drawing with replacement from the original dataset.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RandomSampler

      public RandomSampler()
      Constructs a new instance of the RandomSampler.
  • Method Details

    • sample

      public static DataSet sample(DataSet dataSet, int newSampleSize)
      This method takes a dataset and a sample size and creates a new dataset containing that number of samples by drawing with replacement from the original dataset.
      Parameters:
      dataSet - a DataSet object
      newSampleSize - a int
      Returns:
      a DataSet object