code: def cv_estimate(n_splits=None):
      cv = KFold(n_splits=n_splits)
      cv_clf = ensemble.GradientBoostingClassifier(**params)
      val_scores = np.zeros((n_estimators,), dtype=np.float64)
      for train, test in cv.split(X_train, y_train):
          cv_clf.fit(X_train[train], y_train[train])
          val_scores += heldout_score(
              cv_clf, X_train[test], y_train[test]
          )
      val_scores /= n_splits
      return val_scores
  
file_path: scikit-learn/examples/ensemble/plot_gradient_boosting_oob.py
imports: import matplotlib.pyplot
  import numpy
  from scipy.special import expit
  from sklearn import ensemble
  from sklearn.metrics import log_loss
  from sklearn.model_selection import KFold, train_test_split
label_desc: Use image node_id 2 for calling a global function with example usage: cv_estimate(n_splits) and returns: val_scores