python $ pred和$ folds不起作用

时间:2017-12-19 01:22:22

标签: python classification knn

我尝试使用HOG-descriptors来使用KernelKnnCv来解决cifar-10数据集分类问题。我找到了这段代码:

X, y = data, labels

hog = HOG_apply(X,cells = 6,orientations = 9,rows = 32,columns = 32,threads = 6)
fit_hog = KernelKnnCV(hog, y, k = 20, folds = 4, method = 'braycurtis',
                      weights_function = 'biweight_tricube_MULT', regression = F,
                      threads = 6, Levels = sort(unique(y)))
acc_fit_hog = unlist(lapply(1:length(fit_hog$preds),function(x) acc(y[fit_hog$folds[[x]]]
                    ,fit_hog$preds[[x]])))

我因为$ preds和$ folds而出现语法错误。如何解决?

0 个答案:

没有答案