@PublicationReference(title="Random Subspace Method", author="Wikipedia", year=2011, type=WebPage, url="http://en.wikipedia.org/wiki/Random_subspace_method") public class RandomSubspace extends AbstractRandomized implements BatchLearner<java.util.Collection<? extends Vectorizable>,SubVectorEvaluator>, Randomized, VectorFactoryContainer
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIZE
The default size is 10.
|
protected int |
size
The size of the random subspace to create, which is the number of
dimensions that are chosen.
|
protected VectorFactory<?> |
vectorFactory
The vector factory for the sub vector evaluator to use.
|
random
Constructor and Description |
---|
RandomSubspace()
Creates a new
RandomSubspace with the default size. |
RandomSubspace(int size)
Creates a new
RandomSubspace with the given size. |
RandomSubspace(int size,
java.util.Random random)
Creates a new
RandomSubspace with the given parameters. |
RandomSubspace(int size,
java.util.Random random,
VectorFactory<?> vectorFactory)
Creates a new
RandomSubspace with the given parameters. |
Modifier and Type | Method and Description |
---|---|
int |
getSize()
Gets the size of the subspace that will be created.
|
VectorFactory<? extends Vector> |
getVectorFactory()
Gets the vector factory the object to use to create new vectors.
|
SubVectorEvaluator |
learn(java.util.Collection<? extends Vectorizable> data)
The
learn method creates an object of ResultType using
data of type DataType , using some form of "learning" algorithm. |
void |
setSize(int size)
Sets the size of the subspace that will be created.
|
void |
setVectorFactory(VectorFactory<?> vectorFactory)
Sets the vector factory to use.
|
clone, getRandom, setRandom
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
getRandom, setRandom
public static final int DEFAULT_SIZE
protected int size
protected VectorFactory<?> vectorFactory
public RandomSubspace()
RandomSubspace
with the default size.public RandomSubspace(int size)
RandomSubspace
with the given size.size
- The size of the subspace to create. Must be positive.public RandomSubspace(int size, java.util.Random random)
RandomSubspace
with the given parameters.size
- The size of the subspace to create. Must be positive.random
- The random number generator to use.public RandomSubspace(int size, java.util.Random random, VectorFactory<?> vectorFactory)
RandomSubspace
with the given parameters.size
- The size of the subspace to create. Must be positive.random
- The random number generator to use.vectorFactory
- The vector factory to use in the result to createpublic SubVectorEvaluator learn(java.util.Collection<? extends Vectorizable> data)
BatchLearner
learn
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 Vectorizable>,SubVectorEvaluator>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public int getSize()
public void setSize(int size)
size
- The size of the subspace that will be created. Must be positive.public VectorFactory<? extends Vector> getVectorFactory()
VectorFactoryContainer
getVectorFactory
in interface VectorFactoryContainer
public void setVectorFactory(VectorFactory<?> vectorFactory)
vectorFactory
- The vector factory to use.