class_docstr: Classifier wrapper of the StructureModel.
  Implements the sklearn .fit and .predict interface.
  
  Example:
  ::
      >>> from causalnex.sklearn import DAGRegressor
      >>>
      >>> clf = DAGClassifier(threshold=0.1)
      >>> clf.fit(X_train, y_train)
      >>>
      >>> y_preds = clf.predict(X_test)
      >>> type(y_preds)
      np.ndarray
      >>>
      >>> type(clf.feature_importances_)
      np.ndarray
  ::
  
  Attributes:
      feature_importances_ (np.ndarray): An array of edge weights corresponding
      positionally to the feature X.
  
      coef_ (np.ndarray): An array of edge weights corresponding
      positionally to the feature X.
  
      intercept_ (float): The target node bias value.
class_docstr_tok: ["Classifier","wrapper","of","the","StructureModel",".","Implements","the","sklearn",".fit","and",".predict","interface",".","Example",":",":",":",">",">",">","from","causalnex.sklearn","import","DAGRegressor",">",">",">",">",">",">","clf","=","DAGClassifier","(","threshold=0.1",")",">",">",">","clf.fit","(","X_train",",","y_train",")",">",">",">",">",">",">","y_preds","=","clf.predict","(","X_test",")",">",">",">","type","(","y_preds",")","np.ndarray",">",">",">",">",">",">","type","(","clf.feature_importances_",")","np.ndarray",":",":","Attributes",":","feature_importances_","(","np.ndarray",")",":","An","array","of","edge","weights","corresponding","positionally","to","the","feature","X.","coef_","(","np.ndarray",")",":","An","array","of","edge","weights","corresponding","positionally","to","the","feature","X.","intercept_","(","float",")",":","The","target","node","bias","value","."]
docstr: Unsigned importances of the features wrt to the target.
  NOTE: these are used as the graph adjacency matrix.
  Returns:
      the L2 relationship between nodes.
      shape: (1, n_features) or (n_classes, n_features).
docstr_tok: ["Unsigned","importances","of","the","features","wrt","to","the","target",".","NOTE",":","these","are","used","as","the","graph","adjacency","matrix",".","Returns",":","the","L2","relationship","between","nodes",".","shape",":","(","1",",","n_features",")","or","(","n_classes",",","n_features",")","."]
code: def feature_importances_(self) -> np.ndarray:
      """
      Unsigned importances of the features wrt to the target.
      NOTE: these are used as the graph adjacency matrix.
      Returns:
          the L2 relationship between nodes.
          shape: (1, n_features) or (n_classes, n_features).
      """
      n_classes = len(self.classes_)
      # handle binary
      if n_classes == 2:
          return np.asarray(
              self.get_edges_to_node(self._target).values
          ).reshape(1, -1)
  
      # handle categorical
      data = []
      for node in self._target_node_names:
          # stack into (n_classes, n_features) format
          data.append(
              np.asarray(self.get_edges_to_node(node).values).reshape(
                  1, -1
              )
          )
      return np.vstack(data)
  
file_path: causalnex/causalnex/structure/pytorch/sklearn/clf.py
imports: from typing import List, Union
  import numpy
  import pandas
  from sklearn.base import ClassifierMixin
  from sklearn.preprocessing import LabelEncoder
  from sklearn.utils.multiclass import check_classification_targets
  from causalnex.structure.pytorch.dist_type.categorical import DistTypeCategorical
  from causalnex.structure.pytorch.sklearn._base import DAGBase
label_desc: Use image node_id 5 for calling the DAGClassifier obj's underlying member method code with example usage: obj.feature_importances_() and returns: np, np