栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

R kmeans初始化

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

R kmeans初始化

是。您提到的实现允许您指定起始位置。您通过

centers
参数传递它们

> dat <- data.frame(x = rnorm(99, mean = c(-5, 0 , 5)), y = rnorm(99, mean = c(-5, 0, 5)))> plot(dat)> start <- matrix(c(-5, 0, 5, -5, 0, 5), 3, 2)> kmeans(dat, start)K-means clustering with 3 clusters of sizes 33, 33, 33Cluster means:xy1 -5.0222798 -5.065456892 -0.1297747 -0.028902043  4.8006581  5.00315151Clustering vector: [1] 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2[51] 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3Within cluster sum of squares by cluster:[1] 58.05137 73.81878 52.45732 (between_SS / total_SS =  94.7 %)Available components:[1] "cluster"      "centers"      "totss"        "withinss"     "tot.withinss" "betweenss"   [7] "size"


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/650136.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号