pub enum RandomProjectionKind {
Gaussian,
Sparse {
density: Option<OpenClosedUnit<f64>>,
},
}
Expand description
Projection kind that is used to generate the random projection matrix
Variants§
Gaussian
The random projection matrix is dense and its components are sampled
from N(0, 1/k)
Sparse
The random projection matrix is sparse where only density
% of entries
are non-zero.
The matrix’s components are sampled from
-sqrt(1 / (k * density))
with probabilitydensity/2
0
with probability1-density
+sqrt(1 / (k * density))
with probabilitydensity/2
Fields
density: Option<OpenClosedUnit<f64>>
The density
of the sparse projection matrix.
Setting density
to Some(1.0/3.0)
reproduces the settings by
Achlioptas 1. If density
is None
, it is set to 1/sqrt(d)
,
the minimum density as recommended by Li et al 2.
Achlioptas, D. (2003). Database-friendly random projections: Johnson-Lindenstrauss with binary coins. Journal of Computer and System Sciences, 66(4), 671-687. Available from: doi:10.1016/S0022-0000(03)00025-4. ↩
Li, P., Hastie, T. J., and Church, K. W. (2006). Very sparse random projections. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining (KDD ’06). Association for Computing Machinery, New York, NY, USA, 287–296. Available from: doi:10.1145/1150402.1150436. ↩
Trait Implementations§
Source§impl Clone for RandomProjectionKind
impl Clone for RandomProjectionKind
Source§fn clone(&self) -> RandomProjectionKind
fn clone(&self) -> RandomProjectionKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de> Deserialize<'de> for RandomProjectionKind
impl<'de> Deserialize<'de> for RandomProjectionKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for RandomProjectionKind
impl JsonSchema for RandomProjectionKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
§fn always_inline_schema() -> bool
fn always_inline_schema() -> bool
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for RandomProjectionKind
impl RefUnwindSafe for RandomProjectionKind
impl Send for RandomProjectionKind
impl Sync for RandomProjectionKind
impl Unpin for RandomProjectionKind
impl UnwindSafe for RandomProjectionKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)