Pra*_*eep 6 r cluster-analysis dataset data-generation
我目前正在寻找一些工具,可以生成不同形状的数据集,如方形,圆形,矩形等,并带有用于聚类分析的异常值.
您是否可以推荐一个好的数据集生成器进行聚类分析?反正有没有像R这样的语言生成这样的数据集?
我会创建一个形状并提取边界坐标.您可以使用splancs
包填充随机点的形状.
这是我的一个程序的小片段:
# First we create a circle, into which uniform random points will be generated (kudos to Barry Rowlingson, r-sig-geo).
circle <- function(x = x, y = y, r = radius, n = n.faces){
t <- seq(from = 0, to = 2 * pi, length = n + 1)[-1]
t <- cbind(x = x + r * sin(t), y = y+ r * cos(t))
t <- rbind(t, t[1,])
return(t)
}
csr(circle(0, 0, 100, 30), 1000)
Run Code Online (Sandbox Code Playgroud)
随意添加异常值.解决这个问题的一种方法是采样不同的形状并以不同的方式连接它们.