?? weightedknnrule.m
字號:
% Learns classifier and classifies test set% using weighted k-NN rule% Usage% [trainError, testError, estTrainLabels, estTestLabels] = ...% weightedKNNRule_VC(trainFeatures, trainLabels,params ,testFeatures, testLabels)% where%% Inputs:% trainFeatures - the training set vectors, one vector per column% trainLabels - the labels of the above% params - k, the number of nearest neighbors% weightFile, a file with the weights, a% a vector having k (non-increasing) entries. % Entry 1 is the weight of the nearest neighbor,% while entry k is the weight of the farthest neighbor% IF weightFile IS NOT PROVIDED, DEFAULT weights are% provided using the MacLeod, Luk and Titterington% weights with parameters s = 2k, and alpha = .5% (see lecture notes)% testFeatures - test set, one column per vector% testLabels - labels for test set%% Outputs% trainError - the error rate on the training set (one entry per% class + total error)% testError - the error rate on the test set (one entry per class% + total error)% estTrainLabels - the labels produced by the algorithm for the% training samples% estTestLabels - the labels produced by the algorithm for the% test samplesfunction [features, targets] = weightedKNNRule(train_features, train_targets, params, region, plot_on)fprintf('The method has not been implemented\n');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -