Sample (Kennard-Stone)
Synopsis
This operator creates a sample from the given ExampleSet by using the Kennard-Stone algorithm. The size of the sample can be specified on absolute and relative basis.
Description
The Sample (Kennard-Stone) operator performs a Kennard-Stone Sampling. This sampling algorithm works as follows:
- Find the two most separated points in the ExampleSet.
- For each candidate point, find the smallest distance to any already selected object.
- Select the point which has the largest of these smallest distances.
The sampling operators are similar to the <reference key="operator.filter_examples">Filter Examples</reference>
operator in principle that they take an ExampleSet as input and delivers a subset of the ExampleSet as output. The difference is this that the Filter Examples operator filters examples on the basis of specified conditions. But the Sample operators focus on the number of examples and class distribution in the resultant sample. Moreover, the samples are generated randomly. The number of examples in the sample can be specified on absolute and relative basis depending on the setting of the sample parameter.
Input
example set input
This input port expects an ExampleSet. It is output of the Retrieve operator in the attached Example Process.
Output
example set output
The Kennard-Stone algorithm is applied and the resultant sample of the input ExampleSet is output of this port.
original
The ExampleSet that was given as input is passed without changing to the output through this port. This is usually used to reuse the same ExampleSet in further operators or to view the ExampleSet in the Results Workspace.
Parameters
Sample
This parameter determines how the amount of data is specified.
- absolute: If the sample parameter is set to 'absolute' then the sample is created of an exactly specified number of examples. The required number of examples is specified in the sample size parameter.
- relative: If the sample parameter is set to 'relative' then the sample is created as a fraction of the total number of examples in the input ExampleSet. The required ratio of examples is specified in the sample ratio parameter.
Sample size
This parameter specifies the exact number of examples which should be sampled. This parameter is only available when the sample parameter is set to 'absolute'.
Sample ratio
This parameter specifies the fraction of examples which should be sampled. This parameter is only available when the sample parameter is set to 'relative'.