Skip to content

Commit 9161b1e

Browse files
committed
flip sign of second principal component
1 parent 759ae88 commit 9161b1e

File tree

4 files changed

+40
-25
lines changed

4 files changed

+40
-25
lines changed

classix.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@
9494
if size(U,2) == 1 % deal with 1-dim feature
9595
U(:,2) = 0; % for the plotting
9696
end
97-
u = U(:,1); % scores
98-
u = u*sign(-u(1)); % flip to enforce deterministic output
97+
U(:,1) = U(:,1)*sign(-U(1,1)); % flip to enforce deterministic output
98+
U(:,2) = U(:,2)*sign(-U(1,2)); % also for plotting
99+
u = U(:,1); % scores
99100
[u,ind] = sort(u);
100101
x = x(:,ind);
101102
half_r2 = radius^2/2;

demos/Segmenting_Greek_coins.ipynb

Lines changed: 37 additions & 23 deletions
Large diffs are not rendered by default.

demos/Segmenting_Greek_coins.mlx

56.2 KB
Binary file not shown.

matxsubmat.mexw64

15.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)