docstr: Fits CEVAE.
  
  Args:
      X (np.matrix or np.array or pd.Dataframe): a feature matrix
      treatment (np.array or pd.Series): a treatment vector
      y (np.array or pd.Series): an outcome vector
docstr_tok: ["Fits","CEVAE",".","Args",":","X","(","np.matrix","or","np.array","or","pd.Dataframe",")",":","a","feature","matrix","treatment","(","np.array","or","pd.Series",")",":","a","treatment","vector","y","(","np.array","or","pd.Series",")",":","an","outcome","vector"]
code: def fit(self, X, treatment, y, p=None):
      """
      Fits CEVAE.
  
      Args:
          X (np.matrix or np.array or pd.Dataframe): a feature matrix
          treatment (np.array or pd.Series): a treatment vector
          y (np.array or pd.Series): an outcome vector
      """
      X, treatment, y = convert_pd_to_np(X, treatment, y)
  
      self.cevae = CEVAEModel(
          outcome_dist=self.outcome_dist,
          feature_dim=X.shape[-1],
          latent_dim=self.latent_dim,
          hidden_dim=self.hidden_dim,
          num_layers=self.num_layers,
      )
  
      self.cevae.fit(
          x=torch.tensor(X, dtype=torch.float),
          t=torch.tensor(treatment, dtype=torch.float),
          y=torch.tensor(y, dtype=torch.float),
          num_epochs=self.num_epochs,
          batch_size=self.batch_size,
          learning_rate=self.learning_rate,
          learning_rate_decay=self.learning_rate_decay,
          weight_decay=self.weight_decay,
      )
  
file_path: causalml/causalml/inference/nn/cevae.py
imports: import logging
  import torch
  from pyro.contrib.cevae import CEVAE
  from causalml.inference.meta.utils import convert_pd_to_np
label_desc: Use image node_id 2 for calling the CEVAE obj's underlying member method code with example usage: obj.fit(X, treatment, y, p) without return types