机器学习(八) — K-means

model 5 — K-means

1 definition

  1. randomly initialize K cluster centroids μ 1 , μ 2 , ⋯ \mu_1, \mu_2, \cdots μ1,μ2,
  2. repeat:
    • assign each point to its closest centroid μ \mu μ
    • recompute the centroids(average of the closest point)

在这里插入图片描述

2 optimazation objective

  1. c ( i ) c^{(i)} c(i) = index of cluster to which example x ( i ) x^{(i)} x(i) is currently assigned
  2. μ k \mu_k μk = cluster centroid k
  3. μ c ( i ) \mu_{c^{(i)}} μc(i) = cluster centroid of cluster to which example x ( i ) x^{(i)} x(i) has been assigned

J = 1 m ∑ i = 1 m ∥ x ( i ) − μ c ( i ) ∥ J = \frac{1}{m} \sum_{i=1}^m \| x^{(i)} - \mu_{c^{(i)}} \| J=m1i=1mx(i)μc(i)

3 randomly initialization

for i = 1 to n(usually 50 to 1000)
	randomly initialize K-means
	run K-means
	compute cost function
	
pick set of clusters that give the lowest cost

相关推荐

  1. 机器学习模型—K means

    2024-01-18 16:38:03       20 阅读
  2. 机器学习-什么是 k-means

    2024-01-18 16:38:03       9 阅读
  3. K-means 算法【python,算法,机器学习

    2024-01-18 16:38:03       9 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-18 16:38:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-18 16:38:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-18 16:38:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-18 16:38:03       18 阅读

热门阅读

  1. Vue-组件缓存-keep-alive

    2024-01-18 16:38:03       32 阅读
  2. 边缘计算和联邦学习的联系

    2024-01-18 16:38:03       32 阅读
  3. 边缘计算的挑战和机遇——数据安全与隐私保护

    2024-01-18 16:38:03       41 阅读
  4. 【无标题】

    2024-01-18 16:38:03       31 阅读
  5. 华为:交换机忘记console密码重置

    2024-01-18 16:38:03       101 阅读
  6. SpringBoot异常处理和单元测试

    2024-01-18 16:38:03       40 阅读
  7. Vue3 动态设置 ref

    2024-01-18 16:38:03       41 阅读
  8. vue3 setup语法糖

    2024-01-18 16:38:03       41 阅读