class_docstr: Sparse Random Projection using PyTorch operations.
  
  Args:
      eps (float, optional): Minimum distortion rate parameter for calculating
          Johnson-Lindenstrauss minimum dimensions. Defaults to 0.1.
      random_state (int | None, optional): Uses the seed to set the random
          state for sample_without_replacement function. Defaults to None.
docstr: Project the data by using matrix product with the random matrix.
  
  Args:
      embedding (Tensor): Embedding of shape (n_samples, n_features)
          The input data to project into a smaller dimensional space
  
  Returns:
      projected_embedding (Tensor): Sparse matrix of shape
          (n_samples, n_components) Projected array.
docstr_tok: ["Project","the","data","by","using","matrix","product","with","the","random","matrix",".","Args",":","embedding","(","Tensor",")",":","Embedding","of","shape","(","n_samples",",","n_features",")","The","input","data","to","project","into","a","smaller","dimensional","space","Returns",":","projected_embedding","(","Tensor",")",":","Sparse","matrix","of","shape","(","n_samples",",","n_components",")","Projected","array","."]
code: def transform(self, embedding: Tensor) -> Tensor:
      """Project the data by using matrix product with the random matrix.
  
      Args:
          embedding (Tensor): Embedding of shape (n_samples, n_features)
              The input data to project into a smaller dimensional space
  
      Returns:
          projected_embedding (Tensor): Sparse matrix of shape
              (n_samples, n_components) Projected array.
      """
      if self.sparse_random_matrix is None:
          raise NotFittedError(
              "`fit()` has not been called on SparseRandomProjection yet."
          )
  
      projected_embedding = (
          embedding @ self.sparse_random_matrix.T.float()
      )
      return projected_embedding
  
file_path: anomalib/src/anomalib/models/components/dimensionality_reduction/random_projection.py
imports: from __future__ import annotations
  import numpy
  import torch
  from sklearn.utils.random import sample_without_replacement
  from torch import Tensor
label_desc: Use image node_id 5 for calling the SparseRandomProjection obj's underlying member method code with example usage: obj.transform(embedding) and returns: projected_embedding