数据挖掘---聚类动画演示

来源:互联网 发布:ios算法面试题及答案 编辑:程序博客网 时间:2024/05/17 09:05

我 的资源
聚类动画示例演示:

setwd("E://RProgramming//聚类动画")library(R2SWF)library(animation)output = dev2swf({  par(mar = c(3, 3, 1, 1.5), mgp = c(1.5, 0.5, 0))  kmeans.ani()}, output = "test.swf")swf2html(output)

中国城市聚类动画演示:

setwd("E://RProgramming//中国地图动画聚类")library(R2SWF)library(animation)data<-read.csv("citycoordinate.csv")# View(data)x<-data$东# View(x)y<-data$北纬output = dev2swf({  par(mar = c(3, 3, 1, 1.5), mgp = c(1.5, 0.5, 0))  # par(x,y)  kmeans.ani(x=cbind(x,y),centers = 4)}, output = "test.swf")swf2html(output)

工资和收入聚类动画演示:

setwd("E://RProgramming//customer")library(R2SWF)library(animation)data<-read.csv("customer.csv")# View(data)xx<-data$age# View(x)yy<-data$incomeoutput = dev2swf({  par(mar = c(3, 3, 1, 1.5), mgp = c(1.5, 0.5, 0))  # par(x,y)  # kmeans.ani(x=cbind(xx,yy),centers = 4)  kmeans.ani(x = cbind(xx, yy), centers = 3,              hints = c("Move centers!", "Find cluster?"), pch = 1:3, col = 1:3)}, output = "test.swf")swf2html(output)
0 0
原创粉丝点击