class_docstr: Represents an post nonlinear FCM, i.e. models of the form:
      Y = g(f(X) + N),
  where X are parent nodes of the target node Y, f an arbitrary prediction model expecting inputs from the
  parents X, N a noise variable and g an invertible function.
class_docstr_tok: ["Represents","an","post","nonlinear","FCM",",","i.e",".","models","of","the","form",":","Y","=","g","(","f","(","X",")","+","N",")",",","where","X","are","parent","nodes","of","the","target","node","Y",",","f","an","arbitrary","prediction","model","expecting","inputs","from","the","parents","X",",","N","a","noise","variable","and","g","an","invertible","function","."]
docstr: Evaluates the post non-linear model given samples (X, N). This is done by:
  
      1. Evaluate f(X)
      2. Evaluate f(X) + N
      3. Return g(f(X) + N)
  
  :param parent_samples: Samples from the inputs X.
  :param noise_samples: Samples from the noise N.
  :return: The Y values based on the given samples.
docstr_tok: ["Evaluates","the","post","non-linear","model","given","samples","(","X",",","N",")",".","This","is","done","by",":","1",".","Evaluate","f","(","X",")","2",".","Evaluate","f","(","X",")","+","N","3",".","Return","g","(","f","(","X",")","+","N",")",":","param","parent_samples",":","Samples","from","the","inputs","X.",":","param","noise_samples",":","Samples","from","the","noise","N.",":","return",":","The","Y","values","based","on","the","given","samples","."]
code: def evaluate(
      self, parent_samples: np.ndarray, noise_samples: np.ndarray
  ) -> np.ndarray:
      """Evaluates the post non-linear model given samples (X, N). This is done by:
  
          1. Evaluate f(X)
          2. Evaluate f(X) + N
          3. Return g(f(X) + N)
  
      :param parent_samples: Samples from the inputs X.
      :param noise_samples: Samples from the noise N.
      :return: The Y values based on the given samples.
      """
      parent_samples, noise_samples = shape_into_2d(
          parent_samples, noise_samples
      )
      predictions = shape_into_2d(
          self._prediction_model.predict(parent_samples)
      )
  
      return self._invertible_function.evaluate(
          predictions + noise_samples
      )
  
imports: import copy
  from abc import ABC, abstractmethod
  from typing import List, Optional
  import numpy
  from dowhy.gcm.ml import ClassificationModel, PredictionModel
  from dowhy.gcm.ml.regression import InvertibleFunction, SklearnRegressionModel
  from dowhy.gcm.util.general import is_categorical, is_discrete, shape_into_2d
label_desc: Use image node_id 5 for calling the PostNonlinearModel obj's underlying member method code with example usage: obj.evaluate(parent_samples, noise_samples) and returns: self