→ celestialgod: [N,Xedges,Yedges]= histcounts2(A, B, 0:24, 0:24) 07/15 00:50
→ celestialgod: N就是所求 07/15 00:50
→ celestialgod: N=histcounts2(A, B, 1:17, 1:24); 07/15 00:51
→ celestialgod: 更正,17跟24可以用A跟B的最大值代替 07/15 00:51
→ celestialgod: 對不起 我想錯了 07/15 00:53
→ popo14777: C大這個方法還是不行耶 07/15 09:12
→ popo14777: 喔喔,看到你新發的一封了 07/15 09:15
推 YoursEver: 我會建議設 D = C + random_noise; 然後對D的col vec做 07/15 10:43
→ YoursEver: clustering. 看分群的結果,cluster數就是不同的相量數, 07/15 10:45
→ YoursEver: 每個cluster內的資料點數,就是出現次數. 07/15 10:46
→ YoursEver: 不過當資料不夠大不夠多的時候,不要用這個方法,因為 07/15 10:46
→ YoursEver: 不見得能省計算複雜度. 07/15 10:46
→ popo14777: 謝謝Y大,但我最重要的問題要如何得到11這個數值喔 07/15 13:33
→ popo14777: 已解決,謝謝各位C大與Y大的幫忙 07/17 09:49
推 sunev: CC=C(:,all(C,1)); 07/18 13:35
推 sunev: [N,Xedges,Yedges]=histcounts2(CC(1,:),CC(2,:),... 07/18 13:42
→ sunev: 'BinMethod','integers'); 07/18 13:42
→ sunev: [~,I]=max(N(:));[i,j]=ind2sub(size(N),I); 07/18 13:42
→ sunev: find(C(1,:)==ceil(Xedges(i))&C(2,:)==ceil(Yedges(j))... 07/18 13:43
→ sunev: ,'BinMethod','integers') 07/18 13:43
→ celestialgod: s大你那樣不能用超過2個column的,我有想過XD 07/18 19:16
推 sunev: 啊呀,本來想練習histcounts2的,那還是只能用unique rows 07/18 19:38
→ sunev: [CC,Ia,Ic]=unique(C(:,all(C,1))','rows'); 07/18 19:39
→ sunev: N=histc(Ic,1:size(CC,1));[~,I]=max(N); 07/18 19:39
→ sunev: find(all(bsxfun(@eq,CC(I,:)',C),1),1,'first') 07/18 19:40
推 sunev: 這個版本可能快一點,少一個find及二維@eq,多一個max 07/18 19:54
→ sunev: [CC,Ia,Ic]=unique(C(:,all(C,1))','rows'); 07/18 19:54
→ sunev: N=histc(Ic,1:size(CC,1));[~,I]=max(N); 07/18 19:54
→ sunev: if ~all(CC(I)),N(I)=[];Ia(I)=[];[~,I]=max(N);end 07/18 19:55
→ sunev: Ia(I) 07/18 19:55
推 YoursEver: 這個問題,我考慮的點一直是: 如果是高維向量該怎麼辦? 07/19 11:36
→ YoursEver: 所以才會在一開始想直接在高維空間上做clustering, 07/19 11:37
→ YoursEver: 後來改成採取hashing的概念,把向量換算成某個scalar, 07/19 11:38
→ YoursEver: 接下來就只需要從一串scalar裡面找眾數而已. 07/19 11:39
→ YoursEver: 我比較有興趣知道,如果當輸入的k-by-N矩陣非常大的時候 07/19 11:40
→ YoursEver: 該用什麼觀點看這個問題會比較有效率... 07/19 11:41
→ YoursEver: 例如: 如果 k=256, N=100,000 這種規模. 07/19 11:42
推 sunev: 就偷懶用內建unique rows來處理vector -> scalar的問題 07/19 13:13