// Compute the kernel
double[][] matrix = kernel.compute(dataset, instances, blacklist, k1, k2);
double[] cs = {0.001, 0.01, 0.1, 1, 10, 100, 1000};
LibSVMParameters parms = new LibSVMParameters(LibSVMParameters.C_SVC, cs);
parms.setWeightLabels(EvaluationUtils.computeWeightLabels(target));
parms.setWeights(EvaluationUtils.computeWeights(target));
// For simplicity we do CV, but kernel can also be split in train/test split, which is slightly more involved.
Prediction[] pred = LibSVM.crossValidate(matrix, EvaluationUtils.target2Doubles(target), parms, 5);
System.out.println("Acc: " + (new Accuracy()).computeScore(EvaluationUtils.target2Doubles(target), pred));