Permalink
Browse files

Speed optimization.

  • Loading branch information...
1 parent 2894507 commit ce4d76ee3f2072e7fab5ca2e204740e4c96bde58 @meqif committed Mar 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 knn_predict.m
View
@@ -31,7 +31,7 @@
diff = bsxfun(@minus, traindata, current_line);
% contar atributos (colunas) diferentes (reduz para uma coluna)
- differences = sum(spones(diff), 2);
+ differences = sum((diff ~= 0), 2);
% juntar coluna de diferenças com coluna de classes
y = horzcat(differences, train_Clabels);

0 comments on commit ce4d76e

Please sign in to comment.