class_docstr: Compute effect of treatment using some regression function.
  
  Fits a regression model for estimating the outcome using treatment(s) and
  confounders.
  
  Base class for all regression models, inherited by
  LinearRegressionEstimator and GeneralizedLinearModelEstimator.
class_docstr_tok: ["Compute","effect","of","treatment","using","some","regression","function",".","Fits","a","regression","model","for","estimating","the","outcome","using","treatment","(","s",")","and","confounders",".","Base","class","for","all","regression","models",",","inherited","by","LinearRegressionEstimator","and","GeneralizedLinearModelEstimator","."]
docstr: Encodes categorical columns in the given data, returning a new dataframe containing
  all original data and the encoded columns. Numerical data is unchanged, categorical
  types are one-hot encoded. `encoder_name` identifies a specific encoder to be used
  if available, or created if not. The encoder can be reused in subsequent calls.
  
  :param data: Data to encode.
  :param encoder_name: The name for the encoder to be used.
  :returns: The encoded data.
docstr_tok: ["Encodes","categorical","columns","in","the","given","data",",","returning","a","new","dataframe","containing","all","original","data","and","the","encoded","columns",".","Numerical","data","is","unchanged",",","categorical","types","are","one-hot","encoded",".","`","encoder_name","`","identifies","a","specific","encoder","to","be","used","if","available",",","or","created","if","not",".","The","encoder","can","be","reused","in","subsequent","calls",".",":","param","data",":","Data","to","encode",".",":","param","encoder_name",":","The","name","for","the","encoder","to","be","used",".",":","returns",":","The","encoded","data","."]
code: def _encode(self, data: pd.DataFrame, encoder_name: str):
      """
      Encodes categorical columns in the given data, returning a new dataframe containing
      all original data and the encoded columns. Numerical data is unchanged, categorical
      types are one-hot encoded. `encoder_name` identifies a specific encoder to be used
      if available, or created if not. The encoder can be reused in subsequent calls.
  
      :param data: Data to encode.
      :param encoder_name: The name for the encoder to be used.
      :returns: The encoded data.
      """
      existing_encoder = self._encoders.get(encoder_name)
      encoded_variables, encoder = one_hot_encode(
          data,
          drop_first=self.encoder_drop_first,
          encoder=existing_encoder,
      )
  
      # Remember encoder
      self._encoders[encoder_name] = encoder
      return encoded_variables
  
file_path: dowhy/dowhy/causal_estimators/regression_estimator.py
imports: from typing import Any, List, Optional, Union
  import numpy
  import pandas
  import statsmodels.api
  from dowhy.causal_estimator import CausalEstimate, CausalEstimator, IdentifiedEstimand
  from dowhy.utils.encoding import one_hot_encode
label_desc: Use image node_id 3 for calling the RegressionEstimator obj's underlying member method code with example usage: obj._encode(data, encoder_name) and returns: encoded_variables