class_docstr: Base class for all sklearn wrappers of the StructureModel.
  Implements the sklearn .fit and .predict interface.
class_docstr_tok: ["Base","class","for","all","sklearn","wrappers","of","the","StructureModel",".","Implements","the","sklearn",".fit","and",".predict","interface","."]
docstr: Uses the fitted NOTEARS algorithm to reconstruct y from known X data.
  
  Returns:
      Predicted y values for each row of X.
docstr_tok: ["Uses","the","fitted","NOTEARS","algorithm","to","reconstruct","y","from","known","X","data",".","Returns",":","Predicted","y","values","for","each","row","of","X","."]
code: def predict(self, X: Union[pd.DataFrame, np.ndarray]) -> np.ndarray:
      """
      Uses the fitted NOTEARS algorithm to reconstruct y from known X data.
  
      Returns:
          Predicted y values for each row of X.
      """
      # force convert to ndarray
      X = np.asarray(X)
      if self.standardize:
          X = np.asarray(X.copy(), dtype="float")
          X[:, self.continuous_col_idxs] = self._ss_X.transform(
              X[:, self.continuous_col_idxs]
          )
  
      # insert dummy y column
      y_fill = np.zeros(shape=(X.shape[0], 1))
      X = np.hstack([X, y_fill])
  
      # check that the model has been fit
      check_is_fitted(self)
  
      # extract the base solver
      structure_learner = self.graph_.graph["structure_learner"]
      # use base solver to reconstruct data
      X_hat = structure_learner.reconstruct_data(X)
  
      # get the target dist_type
      target_dist_type = self.graph_.nodes(data=True)[self._target][
          "dist_type"
      ]
      # pull off reconstructed y columns
      y_pred = target_dist_type.get_columns(X_hat)
  
      # inverse-standardize
      if self.standardize and self.target_dist_type == "cont":
          y_pred = self._ss_y.inverse_transform(
              y_pred.reshape(-1, 1)
          ).reshape(-1)
  
      return y_pred
  
imports: import copy
  from abc import ABCMeta
  from typing import Dict, Iterable, List, Union
  import numpy
  import pandas
  from IPython.lib.display import IFrame
  from sklearn.base import BaseEstimator
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils.validation import check_is_fitted, check_X_y
  from causalnex.plots import EDGE_STYLE, NODE_STYLE, display_plot_ipython, plot_structure
  from causalnex.structure.pytorch import notears
label_desc: Use image node_id 3 for calling the DAGBase obj's underlying member method code with example usage: obj.predict(X) and returns: y_pred