Package elki.data.projection
Class RandomProjection<V extends NumberVector>
- java.lang.Object
-
- elki.data.projection.RandomProjection<V>
-
- Type Parameters:
V
- Vector type
- All Implemented Interfaces:
Projection<V,V>
public class RandomProjection<V extends NumberVector> extends java.lang.Object implements Projection<V,V>
Randomized projections of the data.This class allows projecting the data with different types of random projections, in particular database friendly projections (as suggested by Achlioptas, see
AchlioptasRandomProjectionFamily
), but also as suggested for locality sensitive hashing (LSH).- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RandomProjection.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description private int
dimensionality
Output dimensionality.private NumberVector.Factory<V>
factory
Vector factory.private RandomProjectionFamily
family
Random projection familyprivate static Logging
LOG
Class logger.private RandomProjectionFamily.Projection
projection
Projection matrix.
-
Constructor Summary
Constructors Constructor Description RandomProjection(int dimensionality, RandomProjectionFamily family)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation
getInputDataTypeInformation()
Input type information.SimpleTypeInformation<V>
getOutputDataTypeInformation()
Output type restrictionvoid
initialize(SimpleTypeInformation<? extends V> in)
InitializeV
project(V data)
Project a single instance.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
factory
private NumberVector.Factory<V extends NumberVector> factory
Vector factory.
-
dimensionality
private int dimensionality
Output dimensionality.
-
projection
private RandomProjectionFamily.Projection projection
Projection matrix.
-
family
private RandomProjectionFamily family
Random projection family
-
-
Constructor Detail
-
RandomProjection
public RandomProjection(int dimensionality, RandomProjectionFamily family)
Constructor.- Parameters:
dimensionality
- Desired dimensionalityfamily
- Random projection family
-
-
Method Detail
-
initialize
public void initialize(SimpleTypeInformation<? extends V> in)
Description copied from interface:Projection
Initialize- Specified by:
initialize
in interfaceProjection<V extends NumberVector,V extends NumberVector>
- Parameters:
in
- Data type to use for projecting.
-
project
public V project(V data)
Description copied from interface:Projection
Project a single instance.- Specified by:
project
in interfaceProjection<V extends NumberVector,V extends NumberVector>
- Parameters:
data
- Data to project- Returns:
- Projected data
-
getInputDataTypeInformation
public TypeInformation getInputDataTypeInformation()
Description copied from interface:Projection
Input type information.- Specified by:
getInputDataTypeInformation
in interfaceProjection<V extends NumberVector,V extends NumberVector>
- Returns:
- Type restriction
-
getOutputDataTypeInformation
public SimpleTypeInformation<V> getOutputDataTypeInformation()
Description copied from interface:Projection
Output type restriction- Specified by:
getOutputDataTypeInformation
in interfaceProjection<V extends NumberVector,V extends NumberVector>
- Returns:
- Output type
-
-