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.

C_gridnumpy array or list, default=None

A list of C parameters for the SVM to choose from. By default, it is set to 10**-7, …, 10**7, divided by the number of examples

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.

Examples using grakel.cross_validate_Kfold_SVM#

Optimizing hyperparameters

Optimizing hyperparameters