class_docstr: All parameters, except for the `generator` argument, are used to configure `acylicgraph`.
  For the setting of the acylic graph generator, please refer to https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/data.html
  
  Parameters
  ----------
  generator: str
      'tuebingen', 'sachs', 'dream4' or 'acylicgraph'
  causal_mechanism: str
      'linear', 'polynomial', 'sigmoid_add', 'sigmoid_mix', 'gp_add', 'gp_mix', 'nn'
  noise: str or function
      Type of noise function to use in the generative process
  noise_coeff: float
      Proportion of noise
  npoints: int
      Total number of data points
  nodes: int
      Total number of nodes (i.e. variables)
  parents_max: int
      Maximum number of parent nodes
  expected_nedges: int
      Number of edge per node expected if erdos graph is used
class_docstr_tok: ["All","parameters",",","except","for","the","`","generator","`","argument",",","are","used","to","configure","`","acylicgraph","`",".","For","the","setting","of","the","acylic","graph","generator",",","please","refer","to","https",":","\/\/fentechsolutions.github.io\/CausalDiscoveryToolbox\/html\/data.html","Parameters","--","--","--","--","--","generator",":","str","'tuebingen","'",",","'sachs","'",",","'dream4","'","or","'acylicgraph'","causal_mechanism",":","str","'linear","'",",","'polynomial","'",",","'sigmoid_add","'",",","'sigmoid_mix","'",",","'gp_add","'",",","'gp_mix","'",",","'nn'","noise",":","str","or","function","Type","of","noise","function","to","use","in","the","generative","process","noise_coeff",":","float","Proportion","of","noise","npoints",":","int","Total","number","of","data","points","nodes",":","int","Total","number","of","nodes","(","i.e",".","variables",")","parents_max",":","int","Maximum","number","of","parent","nodes","expected_nedges",":","int","Number","of","edge","per","node","expected","if","erdos","graph","is","used"]
code: def __init__(
      self,
      generator: str = "sachs",
      causal_mechanism: str = "linear",
      noise: str = "gaussian",
      noise_coeff: float = 0.4,
      npoints: int = 500,
      nodes: int = 20,
      parents_max: int = 5,
      expected_degree: int = 3,
  ) -> None:
      # Currently, there are three datasets as described in https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/data.html
      _dataset = ["tuebingen", "sachs", "dream4"]
      assert generator in _dataset + ["acylicgraph"]
      assert causal_mechanism in [
          "linear",
          "polynomial",
          "sigmoid_add",
          "sigmoid_mix",
          "gp_add",
          "gp_mix",
          "nn",
      ]
      if generator in _dataset:
          self._data, self._ground_truth_graph = cdt.data.load_dataset(
              generator
          )
      else:
          _generator = cdt.data.AcyclicGraphGenerator(
              causal_mechanism=causal_mechanism,
              noise=noise,
              noise_coeff=noise_coeff,
              npoints=npoints,
              nodes=nodes,
              parents_max=parents_max,
              expected_degree=expected_degree,
          )
          self._data, self._ground_truth_graph = _generator.generate()
  
      self._nodes_list = list(self._ground_truth_graph.nodes())
      self._nvars = self._data.shape[1]
      param_links = ng.p.Choice(
          [-1, 0, 1], repetitions=self._nvars * (self._nvars - 1) // 2
      )
      instru = ng.p.Instrumentation(network_links=param_links).set_name(
          ""
      )
      super().__init__(self.objective, instru)
  
file_path: nevergrad/nevergrad/functions/causaldiscovery/core.py
imports: import typing
  import networkx
  import cdt
  from cdt.metrics import precision_recall, SHD
  import nevergrad
  from ..base import ExperimentFunction
label_desc: Use image node_id 1 to create a new CausalDiscovery object from inherited base classes: ExperimentFunction with example: obj = CausalDiscovery(generator, causal_mechanism, noise, noise_coeff, npoints, nodes, parents_max, expected_degree)