flurs.utils.projection
Utility classes for vector projection.
Classes
|
Base class for projection of feature vectors. |
Random Maclaurin Projection. |
|
|
Projection based on a randomly initialized matrix. |
|
Raw projector that does nothing regardless of the parameters i.e., a projector is an identity matrix. |
|
Tensor Sketch Projection. |
- class flurs.utils.projection.BaseProjection(k, p)[source]
Base class for projection of feature vectors.
- Parameters
k (int) – Number of reduced dimensions (i.e. rows of projection mat.).
p (int) – Number of input dimensions (i.e. cols of projection mat.).
p
will be increased in the future due to new user/item/context insersion.
- class flurs.utils.projection.RandomMaclaurinProjection(k, p)[source]
Random Maclaurin Projection.
- Parameters
k (int) – Number of reduced dimensions (i.e. rows of projection mat.).
p (int) – Number of input dimensions (i.e. cols of projection mat.).
p
will be increased in the future due to new user/item/context insersion.
- class flurs.utils.projection.RandomProjection(k, p, density=0.2)[source]
Projection based on a randomly initialized matrix.
- Parameters
k (int) – Number of reduced dimensions (i.e. rows of projection mat.).
p (int) – Number of input dimensions (i.e. cols of projection mat.).
p
will be increased in the future due to new user/item/context insersion.density (float, default=0.2) – Density parameter used to create a projection matrix.
References
- 1
D. Achlioptas. Database-friendly random projections: Johnson-Lindenstrauss with binary coins.
- 2
Li, et al. Very sparse random projections.
- 3
- class flurs.utils.projection.Raw(k, p)[source]
Raw projector that does nothing regardless of the parameters i.e., a projector is an identity matrix.
- Parameters
k (int) – Number of reduced dimensions (i.e. rows of projection mat.).
p (int) – Number of input dimensions (i.e. cols of projection mat.).
p
will be increased in the future due to new user/item/context insersion.
- class flurs.utils.projection.TensorSketchProjection(k, p)[source]
Tensor Sketch Projection.
- Parameters
k (int) – Number of reduced dimensions (i.e. rows of projection mat.).
p (int) – Number of input dimensions (i.e. cols of projection mat.).
p
will be increased in the future due to new user/item/context insersion.