class_docstr: A classifier 2 sample test, which tests for a difference between a source and target dataset.  It fits a
  classifier to predict if a sample is in the source and target dataset, then computes an evaluation metric on a
  holdout which becomes the test statistic.
  
  Parameters
  ----------
  classifier_class : an AutoGluon predictor, such as autogluon.tabular.TabularPredictor
      The predictor (classifier) class to classify the source from target dataset, predictor class needs to support
      binary classification
  sample_label : str, default = 'xshift_label'
      The label that will be used to indicate if the sample is from training or test
  eval_metric : callable, default = autogluon.core.metrics.balanced_accuracy
      Binary classification metric to use for the classifier 2 sample test, currently only metrics that accept binary
      predictions are supported, such as balanced_accuracy
  compute_fi : bool, default = True
      To compute the feature importances set to True, this can be computationally intensive
  split : float, default = 0.5
      Training/test split proportion for classifier 2 sample test
  classifier_kwargs : dict, default = {}
      The kwargs passed to the classifier, a member of classifier_class
  test_size_2st: float, default = 0.3
      The size of the test set in the training test split in 2ST
docstr: Fit the classifier for predicting if source or target and compute the 2-sample test statistic.
  
  Parameters
  ----------
  data : pd.DataFrame, or tuple
      either
      - a dataframe with a label column where 1 = target and 0 = source
      - a tuple of source dataframe and target dataframe
docstr_tok: ["Fit","the","classifier","for","predicting","if","source","or","target","and","compute","the","2-sample","test","statistic",".","Parameters","--","--","--","--","--","data",":","pd.DataFrame",",","or","tuple","either","-","a","dataframe","with","a","label","column","where","1","=","target","and","0","=","source","-","a","tuple","of","source","dataframe","and","target","dataframe"]
code: def fit(self, data, **kwargs):
      """Fit the classifier for predicting if source or target and compute the 2-sample test statistic.
  
      Parameters
      ----------
      data : pd.DataFrame, or tuple
          either
          - a dataframe with a label column where 1 = target and 0 = source
          - a tuple of source dataframe and target dataframe
      """
      if isinstance(data, pd.DataFrame):
          sample_label = self.sample_label
          assert (
              sample_label in data.columns
          ), "sample_label needs to be a column of data"
          assert self.split, "sample_label requires the split parameter"
          data = data.copy()  # makes a copy
      else:
          assert (
              len(data) == 2
          ), "Data needs to be tuple/list of (source, target) if sample_label is None"
          data = self._make_source_target_label(
              data, self.sample_label
          )  # makes a copy
      if data.index.has_duplicates:
          data = data.reset_index(drop=True)
      train, test, y_train, y_test = generate_train_test_split(
          data.drop(columns=[self.sample_label]),
          data[self.sample_label],
          BINARY,
          test_size=self.test_size_2st,
      )
      train[self.sample_label] = y_train
      test[self.sample_label] = y_test
      self.classifier.fit(train, **kwargs)
      yhat = self.classifier.predict_proba(test)[1]
      self.test_stat = self.eval_metric(test[self.sample_label], yhat)
      self.has_fi = (
          getattr(self.classifier, "feature_importance", None)
          is not None
      )
      if self.has_fi and self.compute_fi:
          self._test = test  # for feature importance
      self._is_fit = True
  
imports: import copy
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  from autogluon.core.constants import BINARY
  from autogluon.core.metrics import BINARY_METRICS, roc_auc
  from autogluon.core.utils import generate_train_test_split
  from autogluon.tabular import TabularPredictor
  from ..None import AnalysisState
  from ..state import StateCheckMixin
  from .base import AbstractAnalysis
label_desc: Use image node_id 3 for calling the Classifier2ST obj's underlying member method code with example usage: obj.fit(data) without return types