class_docstr: Class defining poisson distribution type functionality
docstr: Perform positivity check.
  
  Args:
      X: The original passed-in data.
  
      fit_transform: Whether the class first fits
      then transforms the data, or just transforms.
      Just transforming is used to preprocess new data after the
      initial NOTEARS fit.
  
  Returns:
      Preprocessed X
  
  Raises:
      ValueError: if data has negative values.
docstr_tok: ["Perform","positivity","check",".","Args",":","X",":","The","original","passed-in","data",".","fit_transform",":","Whether","the","class","first","fits","then","transforms","the","data",",","or","just","transforms",".","Just","transforming","is","used","to","preprocess","new","data","after","the","initial","NOTEARS","fit",".","Returns",":","Preprocessed","X","Raises",":","ValueError",":","if","data","has","negative","values","."]
code: def preprocess_X(
      self, X: np.ndarray, fit_transform: bool = True
  ) -> np.ndarray:
      """
      Perform positivity check.
  
      Args:
          X: The original passed-in data.
  
          fit_transform: Whether the class first fits
          then transforms the data, or just transforms.
          Just transforming is used to preprocess new data after the
          initial NOTEARS fit.
  
      Returns:
          Preprocessed X
  
      Raises:
          ValueError: if data has negative values.
      """
      if (X[:, self.idx] < 0).sum() > 0:
          raise ValueError("All data must be positive for Poisson.")
      return X
  
file_path: causalnex/causalnex/structure/pytorch/dist_type/poisson.py
imports: import numpy
  import torch
  from torch import nn
  from causalnex.structure.pytorch.dist_type._base import DistTypeBase
label_desc: Use image node_id 1 for calling the DistTypePoisson obj's underlying member method code with example usage: obj.preprocess_X(X, fit_transform) and returns: X