【分包算法】分包陷落问题
KonghaYao opened this issue · comments
江夏尧 commented
江夏尧 commented
中层陷落问题是由于分包时,中文分包的最后几个字符没有进行处理,不过这些字符都是使用率非常低的字符
江夏尧 commented
江夏尧 commented
const skmeans = require("skmeans")
const data = [1,12,13,4,25,21,22,3,14,5,11,2,23,24,15];
const num = 3
const res = skmeans(data,num);
res.idxs.reduce(
(col,cur,index)=>{
col[cur] .push( data[index])
return col
},
[...Array(num).keys()].map(i=>[])
)
[[25, 21, 22, 23, 24], [12, 13, 14, 11, 15], [1, 4, 3, 5, 2]]
可以尝试使用 kmeans 算法进行离群值分析,从而分出数值小的集群,然后合并
江夏尧 commented
江夏尧 commented
江夏尧 commented
z-score 算法能有效削减低分包值