title: Why can't I match LGBM's cv score?
body: <p>I'm unable to match LGBM's cv score by hand.</p>
  
  <p>Here's a MCVE:</p>
  
  <pre><code>from sklearn.datasets import load_breast_cancer
  import pandas as pd
  from sklearn.model_selection import train_test_split, KFold
  from sklearn.metrics import roc_auc_score
  import lightgbm as lgb
  import numpy as np
  
  data = load_breast_cancer()
  X = pd.DataFrame(data.data, columns=data.feature_names)
  y = pd.Series(data.target)
  X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)
  
  folds = KFold(5, random_state=42)
  
  params = {'random_state': 42}
  
  results = lgb.cv(params, lgb.Dataset(X_train, y_train), folds=folds, num_boost_round=1000, early_stopping_rounds=100, metrics=['auc'])
  print('LGBM\'s cv score: ', results['auc-mean'][-1])
  
  clf = lgb.LGBMClassifier(**params, n_estimators=len(results['auc-mean']))
  
  val_scores = []
  for train_idx, val_idx in folds.split(X_train):
      clf.fit(X_train.iloc[train_idx], y_train.iloc[train_idx])
      val_scores.append(roc_auc_score(y_train.iloc[val_idx], clf.predict_proba(X_train.iloc[val_idx])[:,1]))
  print('Manual score: ', np.mean(np.array(val_scores)))
  </code></pre>
  
  <p>I was expecting the two CV scores to be identical - I have set random seeds, and done exactly the same thing. Yet they differ.</p>
  
  <p>Here's the output I get:</p>
  
  <pre><code>LGBM's cv score:  0.9851513530737058
  Manual score:  0.9903622177441328
  </code></pre>
  
  <p>Why? Am I not using LGMB's <code>cv</code> module correctly?</p>