grakel.cross_validate_Kfold_SVM

grakel.cross_validate_Kfold_SVM(K, y, n_iter=10, n_splits=10, C_grid=None, random_state=None, scoring='accuracy', fold_reduce=None)[source][source]

Cross Validate a list of precomputed kernels with an SVM.

Parameters
Klist

A list that must contain either numpy arrays or iterables of numpy arrays.

ylist

List of lists that for every element of K contains numbers of score for all iterations.

n_iterint

Number of iteration for the K-Fold.

n_splitsint

Number of splits for the K-Fold.

random_stateRandomState or int, default=None

A random number generator instance or an int to initialize a RandomState as a seed.

fold_reducecallable or None

A function that summarizes information between all folds. Input must be a list of n_splits elements corresponding to scoring. If None default is np.mean.

scoringstring, callable, list/tuple, dict or None, default: None

As in scoring in sklearn.model_selection.GridSearchCV.

Returns
outlist

A list that contains a list of the reduced folds for each iteration, for each primary element of K.