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: Find a 'safe' number of components to randomly project to.
  
  Ref eqn 2.1 https://cseweb.ucsd.edu/~dasgupta/papers/jl.pdf
  
  Args:
      n_samples (int): Number of samples used to compute safe components
      eps (float, optional): Minimum distortion rate. Defaults to 0.1.
docstr_tok: ["Find","a","'safe","'","number","of","components","to","randomly","project","to",".","Ref","eqn","2.1","https",":","\/\/cseweb.ucsd.edu\/~dasgupta\/papers\/jl.pdf","Args",":","n_samples","(","int",")",":","Number","of","samples","used","to","compute","safe","components","eps","(","float",",","optional",")",":","Minimum","distortion","rate",".","Defaults","to","0.1","."]
code: def johnson_lindenstrauss_min_dim(
      self, n_samples: int, eps: float = 0.1
  ):
      """Find a 'safe' number of components to randomly project to.
  
      Ref eqn 2.1 https://cseweb.ucsd.edu/~dasgupta/papers/jl.pdf
  
      Args:
          n_samples (int): Number of samples used to compute safe components
          eps (float, optional): Minimum distortion rate. Defaults to 0.1.
      """
  
      denominator = (eps**2 / 2) - (eps**3 / 3)
      return (4 * np.log(n_samples) / denominator).astype(np.int64)
  
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 3 for calling the SparseRandomProjection obj's underlying member method code with example usage: obj.johnson_lindenstrauss_min_dim(n_samples, eps) and returns: unknown