class_docstr: Transformer for binarizing categorical and ordinal (including continuous) features.
  
  Note that all features are converted into binary variables before learning Boolean rules.
docstr: Transform data into binary features.
  
  :param X: Original features as a Pandas Dataframe
  :type X: pd.DataFrame
  :return A: Binary feature dataframe
  :type A: pd.DataFrame
docstr_tok: ["Transform","data","into","binary","features",".",":","param","X",":","Original","features","as","a","Pandas","Dataframe",":","type","X",":","pd.DataFrame",":","return","A",":","Binary","feature","dataframe",":","type","A",":","pd.DataFrame"]
code: def transform(self, X: pd.DataFrame) -> pd.DataFrame:
      """
      Transform data into binary features.
  
      :param X: Original features as a Pandas Dataframe
      :type X: pd.DataFrame
      :return A: Binary feature dataframe
      :type A: pd.DataFrame
      """
      data = X
      maps = self.maps
      enc = self.enc
      thresh = self.thresh
      NaN = self.NaN
  
      # Initialize dataframe
      A = pd.DataFrame(
          index=data.index,
          columns=pd.MultiIndex.from_arrays(
              [[], [], []], names=["feature", "operation", "value"]
          ),
      )
  
      # Iterate over columns
      for c in data:
          # Constant or binary column
          if c in maps:
              # Rename values to 0, 1
              A[(str(c), "", "")] = data[c].map(maps[c])
              if self.negations:
                  A[(str(c), "not", "")] = 1 - A[(str(c), "", "")]
  
          # Categorical column
          elif c in enc:
              # Apply OneHotEncoder
              Anew = enc[c].transform(data[[c]])
              Anew = pd.DataFrame(
                  Anew,
                  index=data.index,
                  columns=enc[c].categories_[0].astype(str),
              )
              if self.negations:
                  # Append negations
                  Anew = pd.concat(
                      [Anew, 1 - Anew],
                      axis=1,
                      keys=[(str(c), "=="), (str(c), "!=")],
                  )
              else:
                  Anew.columns = pd.MultiIndex.from_product(
                      [[str(c)], ["=="], Anew.columns]
                  )
              # Concatenate
              A = pd.concat([A, Anew], axis=1)
  
          # Ordinal column
          elif c in thresh:
              # Threshold values to produce binary arrays
              Anew = (
                  data[c].values[:, np.newaxis] <= thresh[c]
              ).astype(int)
              if self.negations:
                  # Append negations
                  Anew = np.concatenate((Anew, 1 - Anew), axis=1)
                  ops = ["<=", ">"]
              else:
                  ops = ["<="]
              # Convert to dataframe with column labels
              if self.threshStr:
                  Anew = pd.DataFrame(
                      Anew,
                      index=data.index,
                      columns=pd.MultiIndex.from_product(
                          [[str(c)], ops, thresh[c].astype(str)]
                      ),
                  )
              else:
                  Anew = pd.DataFrame(
                      Anew,
                      index=data.index,
                      columns=pd.MultiIndex.from_product(
                          [[str(c)], ops, thresh[c]]
                      ),
                  )
              if c in NaN:
                  # Ensure that rows corresponding to NaN values are zeroed out
                  indNull = data[c].isnull()
                  Anew.loc[indNull] = 0
                  # Add NaN indicator column
                  Anew[(str(c), "==", "NaN")] = indNull.astype(int)
                  if self.negations:
                      Anew[(str(c), "!=", "NaN")] = (~indNull).astype(
                          int
                      )
              # Concatenate
              A = pd.concat([A, Anew], axis=1)
  
          else:
              print(
                  (
                      "Skipping column '"
                      + str(c)
                      + "': data type cannot be handled"
                  )
              )
              continue
  
      return A
  
file_path: dowhy/dowhy/causal_refuters/overrule/BCS/load_process_data_BCS.py
imports: from typing import Dict, List
  import numpy
  import pandas
  from sklearn.base import TransformerMixin
  from sklearn.preprocessing import OneHotEncoder
label_desc: Use image node_id 3 for calling the FeatureBinarizer obj's underlying member method code with example usage: obj.transform(X) and returns: A