title: how to use cross-validation with ktrain?
body: <p>I am using the <code>ktrain</code> package to perform multiclass text classification. The example on the official <code>ktrain</code> website works great (<a href="https://github.com/amaiya/ktrain" rel="nofollow noreferrer">https://github.com/amaiya/ktrain</a>)</p>
  <pre><code>categories = ['alt.atheism', 'soc.religion.christian','comp.graphics', 'sci.med']
  from sklearn.datasets import fetch_20newsgroups
  train_b = fetch_20newsgroups(subset='train', categories=categories, shuffle=True)
  test_b = fetch_20newsgroups(subset='test',categories=categories, shuffle=True)
  (x_train, y_train) = (train_b.data, train_b.target)
  (x_test, y_test) = (test_b.data, test_b.target)
  
  # build, train, and validate model (Transformer is wrapper around transformers library)
  import ktrain
  from ktrain import text
  MODEL_NAME = 'distilbert-base-uncased'
  t = text.Transformer(MODEL_NAME, maxlen=500, class_names=train_b.target_names)
  trn = t.preprocess_train(x_train, y_train)
  val = t.preprocess_test(x_test, y_test)
  model = t.get_classifier()
  learner = ktrain.get_learner(model, train_data=trn, val_data=val, batch_size=6)
  learner.fit_onecycle(5e-5, 4)
  learner.validate(class_names=t.get_classes())
  </code></pre>
  <p>Accuracy is pretty high.</p>
  <p>However, I am comparing this model with other models trained with scikit-learn and, in particular, the other models' accuracy is assessed using cross validation</p>
  <pre><code>cross_val_score(sgd_clf, X_train, y_train, cv=3, scoring=&quot;accuracy&quot;)
  </code></pre>
  <p>How can I adapt the code above to make sure the transformer model used with ktrain is also evaluated with the same cross validation methodology?</p>