pub struct RandomProjection<Proj: ProjectionMethod, F: Float>where
Proj::RandomDistribution: Distribution<F>,{ /* private fields */ }
Expand description
Embedding via random projection
Implementations§
Source§impl<Proj: ProjectionMethod, F: Float> RandomProjection<Proj, F>where
Proj::RandomDistribution: Distribution<F>,
impl<Proj: ProjectionMethod, F: Float> RandomProjection<Proj, F>where
Proj::RandomDistribution: Distribution<F>,
Sourcepub fn params() -> RandomProjectionParams<Proj, Xoshiro256Plus>
pub fn params() -> RandomProjectionParams<Proj, Xoshiro256Plus>
Create new parameters for a RandomProjection
with default value
eps = 0.1
and a Xoshiro256Plus
RNG.
Sourcepub fn params_with_rng<R>(rng: R) -> RandomProjectionParams<Proj, R>
pub fn params_with_rng<R>(rng: R) -> RandomProjectionParams<Proj, R>
Create new parameters for a RandomProjection
with default values
eps = 0.1
and the provided Rng
.
Trait Implementations§
Source§impl<Proj, F, D> Transformer<&ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for RandomProjection<Proj, F>
impl<Proj, F, D> Transformer<&ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for RandomProjection<Proj, F>
Source§impl<'a, Proj, F, L, T> Transformer<&'a DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>, DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, <T as FromTargetArray<'a>>::View>> for RandomProjection<Proj, F>where
Proj: ProjectionMethod,
F: Float,
L: 'a,
T: AsTargets<Elem = L> + FromTargetArray<'a>,
for<'b> ArrayBase<ViewRepr<&'b F>, Ix2>: Dot<Proj::ProjectionMatrix<F>, Output = Array2<F>>,
Proj::RandomDistribution: Distribution<F>,
impl<'a, Proj, F, L, T> Transformer<&'a DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>, DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, <T as FromTargetArray<'a>>::View>> for RandomProjection<Proj, F>where
Proj: ProjectionMethod,
F: Float,
L: 'a,
T: AsTargets<Elem = L> + FromTargetArray<'a>,
for<'b> ArrayBase<ViewRepr<&'b F>, Ix2>: Dot<Proj::ProjectionMatrix<F>, Output = Array2<F>>,
Proj::RandomDistribution: Distribution<F>,
Source§fn transform(
&self,
data: &'a DatasetBase<Array2<F>, T>,
) -> DatasetBase<Array2<F>, T::View>
fn transform( &self, data: &'a DatasetBase<Array2<F>, T>, ) -> DatasetBase<Array2<F>, T::View>
Source§impl<Proj, F, D> Transformer<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for RandomProjection<Proj, F>
impl<Proj, F, D> Transformer<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for RandomProjection<Proj, F>
Source§impl<Proj, F, T> Transformer<DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>, DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>> for RandomProjection<Proj, F>
impl<Proj, F, T> Transformer<DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>, DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>> for RandomProjection<Proj, F>
Source§fn transform(
&self,
data: DatasetBase<Array2<F>, T>,
) -> DatasetBase<Array2<F>, T>
fn transform( &self, data: DatasetBase<Array2<F>, T>, ) -> DatasetBase<Array2<F>, T>
Auto Trait Implementations§
impl<Proj, F> Freeze for RandomProjection<Proj, F>where
<Proj as ProjectionMethod>::ProjectionMatrix<F>: Freeze,
impl<Proj, F> RefUnwindSafe for RandomProjection<Proj, F>where
<Proj as ProjectionMethod>::ProjectionMatrix<F>: RefUnwindSafe,
impl<Proj, F> Send for RandomProjection<Proj, F>where
<Proj as ProjectionMethod>::ProjectionMatrix<F>: Send,
impl<Proj, F> Sync for RandomProjection<Proj, F>where
<Proj as ProjectionMethod>::ProjectionMatrix<F>: Sync,
impl<Proj, F> Unpin for RandomProjection<Proj, F>where
<Proj as ProjectionMethod>::ProjectionMatrix<F>: Unpin,
impl<Proj, F> UnwindSafe for RandomProjection<Proj, F>where
<Proj as ProjectionMethod>::ProjectionMatrix<F>: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.