【吴恩达机器学习笔记】Part3-Week1(上) 非监督学习

1.1 引言
  1. 非监督学习-Unsupervised Learning
    1)聚类算法-Clustering
    2)异常检测-Anomaly Detection
  2. 个性化推荐系统-Recommender System
  3. 强化学习-Reinforcement Learning
2.1 聚类(Clustering)

什么是聚类:输入的数据集中只有特征x,没有标签y(label),需要算法自行找出数据间的关系。
应用:将内容相似的新闻分组(grouping similar news),市场/用户人群分析(market segmentation),DNA 分析(DNA analysis),航天数据分析(Astronomical data analysis)。

2.2 K-means直观理解(K-means intuition)

首先算法猜测数据的中心点——聚类中心 / 簇质心

K-means will take a random guess at where are the centers of the clusters.
The centers of the cluster are called cluster centroids.

步骤一
遍历所有数据点,判断每个数据点距离哪一个簇质心更近,并将数据点分配给更接近的簇质心。

Assign each point to its closest centroid.

步骤二
计算分配好的2(n)组数据点,取出一组,对组内所有数据点计算平均值,并把改组对应的簇质心移动到平均值所在的点;对所有组进行以上操作。

Recompute the centroids.

以上第一次迭代完成后,即通过计算获得新的一组簇质心;重新对所有数据重复步骤一、二的操作,更新簇质心的位置,直到数据分类和簇质心不再改变(算法收敛)。

Look at each point and assign it to the nearest cluster centroid and then move each cluster centroid to the mean of all the points with the same color.

2.3 算法实现(K-means algorithm)

Randomly initialize K cluster centroids μ 1 , μ 2 , … , μ K {\mu _1},{\mu _2}, \ldots ,{\mu _K} μ1,μ2,,μK
Repeat{
# Assign points to cluster centroids
------for i = 1 to m:
----------c(i):=index(1~K) of cluster centroid closest to x(i)
# Move cluster centroids
------for k = 1 to K:
----------μ(k):= average(mean) of points assigned to cluster k
}

2.4 优化目标(optimization objective)

符号

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值