def test_validation_k_fold():
 skip_if_no_sklearn()
 from pylearn2.cross_validation.subset_iterators import ValidationKFold
 n = 30
 cv = ValidationKFold(n)
 for (train, valid, test) in cv:
  assert (np.unique(np.concatenate((train, valid, test))).size == n)
  assert (valid.size == (n / cv.n_folds))
  assert (test.size == (n / cv.n_folds))

def test_validation_k_fold ( ) : skip_if_no_sklearn ( ) from pylearn2 . cross_validation . subset_iterators import ValidationKFold n = 30 cv = ValidationKFold ( n ) for ( train , valid , test ) in cv : assert ( np . unique ( np . concatenate ( ( train , valid , test ) ) ) . size == n ) assert ( valid . size == ( n / cv . n_folds ) ) assert ( test . size == ( n / cv . n_folds ) )
test validationkfold .