OutputType - The output type for the decider.public class RandomSubVectorThresholdLearner<OutputType> extends AbstractRandomized implements VectorThresholdLearner<OutputType>, VectorFactoryContainer
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_PERCENT_TO_SAMPLE
The default percent to sample is 0.1.
|
protected int[] |
dimensionsToConsider
The dimensions to sample from in the learner.
|
protected double |
percentToSample
The percentage of the dimensionality to sample.
|
protected DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> |
subLearner
The decider learner for the subspace.
|
protected VectorFactory<? extends Vector> |
vectorFactory
The vector factory to use.
|
random| Constructor and Description |
|---|
RandomSubVectorThresholdLearner()
Creates a new
RandomSubVectorThresholdLearner. |
RandomSubVectorThresholdLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner,
double percentToSample,
int[] dimensionsToConsider,
java.util.Random random,
VectorFactory<? extends Vector> vectorFactory)
Creates a new
RandomSubVectorThresholdLearner. |
RandomSubVectorThresholdLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner,
double percentToSample,
java.util.Random random)
Creates a new
RandomSubVectorThresholdLearner. |
RandomSubVectorThresholdLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner,
double percentToSample,
java.util.Random random,
VectorFactory<? extends Vector> vectorFactory)
Creates a new
RandomSubVectorThresholdLearner. |
| Modifier and Type | Method and Description |
|---|---|
RandomSubVectorThresholdLearner<OutputType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
int[] |
getDimensionsToConsider()
Gets the dimensions that the learner is to consider.
|
double |
getPercentToSample()
Gets the percent of the dimensionality to sample.
|
int |
getSubDimensionality(int dimensionality)
Gets the dimensionality of the subspace based on the full dimensionality.
|
DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> |
getSubLearner()
Gets the learner used to learn a threshold function over the subspace.
|
VectorFactory<? extends Vector> |
getVectorFactory()
Gets the vector factory.
|
VectorElementThresholdCategorizer |
learn(java.util.Collection<? extends InputOutputPair<? extends Vectorizable,OutputType>> data)
The
learn method creates an object of ResultType using
data of type DataType, using some form of "learning" algorithm. |
void |
setDimensionsToConsider(int... dimensionsToConsider)
Gets the dimensions that the learner is to consider.
|
void |
setPercentToSample(double percentToSample)
Sets the percent of the dimensionality to sample.
|
void |
setSubLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner)
Sets the learner used to learn a threshold function over the subspace.
|
void |
setVectorFactory(VectorFactory<? extends Vector> vectorFactory)
Sets the vector factory.
|
getRandom, setRandompublic static final double DEFAULT_PERCENT_TO_SAMPLE
protected DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner
protected double percentToSample
protected int[] dimensionsToConsider
protected VectorFactory<? extends Vector> vectorFactory
public RandomSubVectorThresholdLearner()
RandomSubVectorThresholdLearner.public RandomSubVectorThresholdLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner, double percentToSample, java.util.Random random)
RandomSubVectorThresholdLearner.subLearner - The threshold decision function learner to use over the subspace.percentToSample - The percentage of the dimensionality to sample (must be between
0.0 (exclusive) and 1.0 (inclusive).random - The random number generator.public RandomSubVectorThresholdLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner, double percentToSample, java.util.Random random, VectorFactory<? extends Vector> vectorFactory)
RandomSubVectorThresholdLearner.subLearner - The threshold decision function learner to use over the subspace.percentToSample - The percentage of the dimensionality to sample (must be between
0.0 and 1.0.random - The random number generator.vectorFactory - The vector factory to use.public RandomSubVectorThresholdLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner, double percentToSample, int[] dimensionsToConsider, java.util.Random random, VectorFactory<? extends Vector> vectorFactory)
RandomSubVectorThresholdLearner.subLearner - The threshold decision function learner to use over the subspace.percentToSample - The percentage of the dimensionality to sample (must be between
0.0 and 1.0.dimensionsToConsider - The array of vector dimensions to consider. Null means all of them
are considered.random - The random number generator.vectorFactory - The vector factory to use.public RandomSubVectorThresholdLearner<OutputType> clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface CloneableSerializableclone in class AbstractRandomizedpublic VectorElementThresholdCategorizer learn(java.util.Collection<? extends InputOutputPair<? extends Vectorizable,OutputType>> data)
BatchLearnerlearn method creates an object of ResultType using
data of type DataType, using some form of "learning" algorithm.learn in interface BatchLearner<java.util.Collection<? extends InputOutputPair<? extends Vectorizable,OutputType>>,VectorElementThresholdCategorizer>data - The data that the learning algorithm will use to create an
object of ResultType.public int getSubDimensionality(int dimensionality)
dimensionality - The full dimensionalitypublic DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> getSubLearner()
public void setSubLearner(DeciderLearner<Vectorizable,OutputType,java.lang.Boolean,VectorElementThresholdCategorizer> subLearner)
subLearner - The learner for the subspace.public double getPercentToSample()
public void setPercentToSample(double percentToSample)
percentToSample - The percent of the dimensionality to sample.public int[] getDimensionsToConsider()
DimensionFilterableLearnergetDimensionsToConsider in interface DimensionFilterableLearnerpublic void setDimensionsToConsider(int... dimensionsToConsider)
DimensionFilterableLearnersetDimensionsToConsider in interface DimensionFilterableLearnerdimensionsToConsider - The array of vector dimensions to consider. Null means all of them
are considered.public VectorFactory<? extends Vector> getVectorFactory()
getVectorFactory in interface VectorFactoryContainerpublic void setVectorFactory(VectorFactory<? extends Vector> vectorFactory)
vectorFactory - The vector factory.