class_docstr: Gradient boosted propensity score model with optional early stopping.
  
  Notes
  -----
  Please see the xgboost documentation for more information on gradient boosting tuning parameters:
  https://xgboost.readthedocs.io/en/latest/python/python_api.html
class_docstr_tok: ["Gradient","boosted","propensity","score","model","with","optional","early","stopping",".","Notes","--","--","-","Please","see","the","xgboost","documentation","for","more","information","on","gradient","boosting","tuning","parameters",":","https",":","\/\/xgboost.readthedocs.io\/en\/latest\/python\/python_api.html"]
docstr: Fit a propensity model.
  
  Args:
      X (numpy.ndarray): a feature matrix
      y (numpy.ndarray): a binary target vector
docstr_tok: ["Fit","a","propensity","model",".","Args",":","X","(","numpy.ndarray",")",":","a","feature","matrix","y","(","numpy.ndarray",")",":","a","binary","target","vector"]
code: def fit(self, X, y, early_stopping_rounds=10, stop_val_size=0.2):
      """
      Fit a propensity model.
  
      Args:
          X (numpy.ndarray): a feature matrix
          y (numpy.ndarray): a binary target vector
      """
  
      if self.early_stop:
          X_train, X_val, y_train, y_val = train_test_split(
              X, y, test_size=stop_val_size
          )
  
          self.model.fit(
              X_train,
              y_train,
              eval_set=[(X_val, y_val)],
              early_stopping_rounds=early_stopping_rounds,
          )
      else:
          super(GradientBoostedPropensityModel, self).fit(X, y)
  
imports: from abc import ABCMeta, abstractmethod
  import logging
  import numpy
  from pygam import LogisticGAM, s
  from sklearn.metrics import roc_auc_score
  from sklearn.linear_model import LogisticRegressionCV
  from sklearn.model_selection import StratifiedKFold, train_test_split
  import xgboost
label_desc: Use image node_id 3 for calling the GradientBoostedPropensityModel obj's underlying member method code with example usage: obj.fit(X, y, early_stopping_rounds, stop_val_size) without return types