longest_run.m

来自「最新的模式识别分类工具箱,希望对朋友们有用!」· M 代码 · 共 20 行

M
20
字号
function L = longest_run(weights, features)%Find the length of the longest run of correctly classified random pointsn = length(features);L = 0;correct = 1;while correct,   L = L + 1;   indice = 1 + floor(rand(1)*n);		%Choose a random indice   if (weights' * features(:,indice) <= 0)	%Find if it is correctly classified      correct = 0;				%If not, stop   end   if (L > n*5),      correct = 0;   endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?