class_docstr: Wrapper class that wraps GBDT models as DeepChem models.
  
  This class supports LightGBM/XGBoost models.
class_docstr_tok: ["Wrapper","class","that","wraps","GBDT","models","as","DeepChem","models",".","This","class","supports","LightGBM\/XGBoost","models","."]
docstr: Fits GDBT model with all data.
  
  First, this function splits all data into train and valid data (8:2),
  and finds the best n_estimators. And then, we retrain all data using
  best n_estimators * 1.25.
  
  Parameters
  ----------
  dataset: Dataset
      The `Dataset` to train this model on.
docstr_tok: ["Fits","GDBT","model","with","all","data",".","First",",","this","function","splits","all","data","into","train","and","valid","data","(","8:2",")",",","and","finds","the","best","n_estimators",".","And","then",",","we","retrain","all","data","using","best","n_estimators","*","1.25",".","Parameters","--","--","--","--","--","dataset",":","Dataset","The","`","Dataset","`","to","train","this","model","on","."]
code: def fit(self, dataset: Dataset):
      """Fits GDBT model with all data.
  
      First, this function splits all data into train and valid data (8:2),
      and finds the best n_estimators. And then, we retrain all data using
      best n_estimators * 1.25.
  
      Parameters
      ----------
      dataset: Dataset
          The `Dataset` to train this model on.
      """
      X = dataset.X
      y = np.squeeze(dataset.y)
  
      # GDBT doesn't support multi-output(task)
      if len(y.shape) != 1:
          raise ValueError(
              "GDBT model doesn't support multi-output(task)"
          )
  
      seed = self.model.random_state
      stratify = None
      if self.model_type == "classification":
          stratify = y
  
      # Find optimal n_estimators based on original learning_rate and early_stopping_rounds
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, test_size=0.2, random_state=seed, stratify=stratify
      )
      self.model.fit(
          X_train,
          y_train,
          callbacks=self.callbacks,
          eval_metric=self.eval_metric,
          eval_set=[(X_test, y_test)],
      )
  
      # retrain model to whole data using best n_estimators * 1.25
      if self.model.__class__.__name__.startswith("XGB"):
          estimated_best_round = np.round(
              (self.model.best_iteration + 1) * 1.25
          )
      else:
          estimated_best_round = np.round(
              self.model.best_iteration_ * 1.25
          )
  
      self.model.n_estimators = np.int64(estimated_best_round)
      self.model.fit(X, y, eval_metric=self.eval_metric)
  
file_path: deepchem/deepchem/models/gbdt_models/gbdt_model.py
imports: import os
  import logging
  import tempfile
  import warnings
  from typing import Callable, Optional, Union
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.model_selection import train_test_split
  from deepchem.data import Dataset
  from deepchem.models.sklearn_models import SklearnModel
label_desc: Use image node_id 3 for calling the GBDTModel obj's underlying member method code with example usage: obj.fit(dataset) without return types