pub struct FittedRandomTreesEmbedding<F> { /* private fields */ }Expand description
A fitted random trees embedding.
Stores the ensemble of randomly built trees. Each tree’s leaves are
enumerated, and Transform produces a one-hot encoded matrix
of shape (n_samples, total_leaves).
Implementations§
Source§impl<F: Float + Send + Sync + 'static> FittedRandomTreesEmbedding<F>
impl<F: Float + Send + Sync + 'static> FittedRandomTreesEmbedding<F>
Sourcepub fn n_estimators(&self) -> usize
pub fn n_estimators(&self) -> usize
Returns the number of trees in the ensemble.
Sourcepub fn n_features(&self) -> usize
pub fn n_features(&self) -> usize
Returns the number of features the model was trained on.
Sourcepub fn n_output_features(&self) -> usize
pub fn n_output_features(&self) -> usize
Returns the total number of output features (total leaves across all trees).
Trait Implementations§
Source§impl<F: Clone> Clone for FittedRandomTreesEmbedding<F>
impl<F: Clone> Clone for FittedRandomTreesEmbedding<F>
Source§fn clone(&self) -> FittedRandomTreesEmbedding<F>
fn clone(&self) -> FittedRandomTreesEmbedding<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for FittedRandomTreesEmbedding<F>
impl<F: Debug> Debug for FittedRandomTreesEmbedding<F>
Source§impl<F: Float + Send + Sync + 'static> FittedPipelineTransformer<F> for FittedRandomTreesEmbedding<F>
impl<F: Float + Send + Sync + 'static> FittedPipelineTransformer<F> for FittedRandomTreesEmbedding<F>
Source§fn transform_pipeline(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn transform_pipeline(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Source§impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedRandomTreesEmbedding<F>
impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedRandomTreesEmbedding<F>
Source§fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Transform the input data into a one-hot encoded leaf-index representation.
For each sample, traverse each tree to a leaf node, then one-hot encode the leaf index within that tree. The encodings for all trees are concatenated horizontally to produce the output.
Output shape: (n_samples, total_leaves_across_all_trees).
§Errors
Returns FerroError::ShapeMismatch if the number of features does
not match the training data.
Source§type Error = FerroError
type Error = FerroError
transform.Auto Trait Implementations§
impl<F> Freeze for FittedRandomTreesEmbedding<F>
impl<F> RefUnwindSafe for FittedRandomTreesEmbedding<F>where
F: RefUnwindSafe,
impl<F> Send for FittedRandomTreesEmbedding<F>where
F: Send,
impl<F> Sync for FittedRandomTreesEmbedding<F>where
F: Sync,
impl<F> Unpin for FittedRandomTreesEmbedding<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedRandomTreesEmbedding<F>
impl<F> UnwindSafe for FittedRandomTreesEmbedding<F>where
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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>
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>
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 more