code: def fit(self, ctx: Context, train_data, validate_data=None):
      if self._header is None:
          header = train_data.schema.columns.to_list()
          self._header = header
          self._prev_selected_mask = pd.Series(
              np.ones(len(header)), dtype=bool, index=header
          )
  
      metric_names = self.param.get("metrics", [])
      # local only
      if self.method in ["statistics"]:
          for metric_name in metric_names:
              if metric_name not in self.model.get("meta", {}).get(
                  "metrics", {}
              ):
                  raise ValueError(
                      f"metric {metric_name} not found in given statistic model with metrics: "
                      f"{self.model.get('metrics', {})}, please check"
                  )
          model_data = self.model.get("data", {})
          metrics_all = pd.DataFrame(
              model_data.get("metrics_summary", {})
          ).loc[metric_names]
          self._all_metrics = metrics_all
          missing_col = set(
              self._prev_selected_mask[self._prev_selected_mask].index
          ).difference(set(metrics_all.columns))
          if missing_col:
              raise ValueError(
                  f"metrics for columns {missing_col} from `select_col` or header not found in given model."
              )
  
          mask_all = self.apply_filter(metrics_all, self.filter_conf)
          self._all_selected_mask = mask_all
          cur_selected_mask = mask_all.all(axis=0)
          cur_selected_mask = [
              cur_selected_mask.get(col, False) for col in self._header
          ]
          self._selected_mask = (
              self._prev_selected_mask & cur_selected_mask
          )
          if self.keep_one:
              self._keep_one(
                  self._selected_mask,
                  self._prev_selected_mask,
                  self._header,
              )
      # federated selection possible
      elif self.method == "iv":
          # host does not perform local iv selection
          if ctx.is_on_host:
              return
          model_data = self.model.get("data", {})
          iv_metrics = pd.Series(model_data["metrics_summary"]["iv"])
          # metrics_all = pd.DataFrame(iv_metrics).T.rename({0: "iv"}, axis=0)
          metrics_all = (
              StandardSelection.convert_series_metric_to_dataframe(
                  iv_metrics, "iv"
              )
          )
          self._all_metrics = metrics_all
          mask_all = self.apply_filter(metrics_all, self.filter_conf)
          self._all_selected_mask = mask_all
          cur_selected_mask = mask_all.all(axis=0)
          cur_selected_mask = [
              cur_selected_mask.get(col, False) for col in self._header
          ]
          self._selected_mask = (
              self._prev_selected_mask & cur_selected_mask
          )
          if self.keep_one:
              self._keep_one(
                  self._selected_mask,
                  self._prev_selected_mask,
                  self._header,
              )
          if self.param.get("select_federated", True):
              host_metrics_summary = self.model.get("data", {}).get(
                  "host_metrics_summary"
              )
              # logger.info(f"host metrics summary: {host_metrics_summary}")
              if host_metrics_summary is None:
                  raise ValueError(
                      f"Host metrics not found in provided model, please check."
                  )
              for host, host_metrics in host_metrics_summary.items():
                  iv_metrics = pd.Series(host_metrics["iv"])
                  # metrics_all = pd.DataFrame(iv_metrics).T.rename({0: "iv"}, axis=0)
                  metrics_all = StandardSelection.convert_series_metric_to_dataframe(
                      iv_metrics, "iv"
                  )
                  self._all_host_metrics[host] = metrics_all
                  host_mask_all = self.apply_filter(
                      metrics_all, self.filter_conf
                  )
                  self._all_host_selected_mask[host] = host_mask_all
                  host_selected_mask = host_mask_all.all(axis=0)
                  if self.keep_one:
                      self._keep_one(host_selected_mask)
                  self._host_selected_mask[host] = host_selected_mask
  
imports: import copy
  import logging
  import math
  import random
  import numpy
  import pandas
  from fate.arch import Context
  from ..abc.module import HeteroModule, Module
label_desc: Use image node_id 7 for calling the StandardSelection obj's underlying member method code with example usage: obj.fit(ctx, train_data, validate_data) without return types