1、For which of the following tasks might K-means clustering be a suitable
algorithm? Select all that apply.
A. Given a database of information about your users, automatically group them into different market segments.
B. Given sales data from a large number of products in a supermarket, figure out which products tend to form coherent groups (say are frequently purchased together) and thus should be put on the same shelf.
C. Given historical weather records, predict the amount of rainfall
tomorrow (this would be a real-valued output)
D. Given sales data from a large number of products in a
supermarket, estimate future sales for each of these products.
答案:AB。K均值算法只要用来分类,但是编程题里的拓展练习也有用来压缩图片,从128×128×24的压缩至16×24+128×128×4的16种颜色

2、Suppose we have three cluster centroids and . Furthermore, we have a training example . After a cluster assignment step, what will c(i) be?
A. c(i) = 1
B. c(i) is not assigned
C. c(i) = 3
D. c(i) = 2
答案:C。直接求x到各个聚类中心的距离就好,到第三个聚类中心的距离为根2,最小,所以归为第三类。

3、K-means is an iterative algorithm, and two of the following steps are repeatedly carried out in its inner-loop. Which two?
A. Randomly initialize the cluster centroids.
B. Test on the cross-validation set.
C. The cluster assignment step, where the parameters c(i) are updated.
D. Move the cluster centroids, where the centroids μk are updated.
答案:CD。A随机初始化聚类中心是K均值的重要步骤,但是不在内部循环里。只用在当聚类中心比较少的时候,用来避开由于初始值不好引起的局部解。

4、Suppose you have an unlabeled dataset {x(1),…,x(m)}. You run K-means with 50 different random initializations, and obtain 50 different clusterings of the data. What is the recommended way for choosing which one of these 50 clusterings to use?
A. Compute the distortion function J(c(1),…,c(m),μ(1),…μ(k)),
and pick the one that minimizes this.
B. Plot the data and the cluster centroids, and pick the clustering that gives the most “coherent” cluster centroids.
C. Use the elbow method.
D.Manually examine the clusterings, and pick the best one.
答案:A。当然代价最小的啊。B不知道是个啥,CD是用来确定聚类中心个数的时候用的,而本题聚类中心个数已经确定了。

5、Which of the following statements are true? Select all that apply.
A. On every iteration of K-means, the cost function J(c(1),…,c(m),μ(1),…μ(k)) (the distortion function) should either stay the same or decrease; in particular, it should not increase.
B. A good way to initialize K-means is to select K (distinct) examples
from the training set and set the cluster centroids equal to these selected examples.
C. K-Means will always give the same results regardless of the initialization of the centroids.
D. Once an example has been assigned to a particular centroid, it will never be reassigned to another different centroid
答案:AB。C错误,K均值算法的效果与初始值的选取有很大的关系,D在迭代过程中一般会一直改变聚类中心的,直到不改变时聚类结束。

【Machine Learning】【Andrew Ng】- Quiz1(Week 8)相关推荐

  1. Machine Learning课程 by Andrew Ng

    大名鼎鼎的机器学习大牛Andrew Ng的Machine Learning课程,在此mark一下: 一:Coursera: https://www.coursera.org/learn/machine ...

  2. Machine learning week 10(Andrew Ng)

    文章目录 Reinforcement learning 1. Reinforcement learning introduction 1.1. What is Reinforcement Learni ...

  3. Machine Learning Outline(Andrew Ng课程总结)

  4. 【Machine Learning】OpenCV中的K-means聚类

    在上一篇([Machine Learning]K-means算法及优化)中,我们介绍了K-means算法的基本原理及其优化的方向.opencv中也提供了K-means算法的接口,这里主要介绍一下如何在 ...

  5. 【原】Coursera—Andrew Ng机器学习—Week 9 习题—异常检测

    [原]Coursera-Andrew Ng机器学习-Week 9 习题-异常检测 参考文章: (1)[原]Coursera-Andrew Ng机器学习-Week 9 习题-异常检测 (2)https: ...

  6. 【Machine Learning 学习笔记】Stochastic Dual Coordinate Ascent for SVM 代码实现

    [Machine Learning 学习笔记]Stochastic Dual Coordinate Ascent for SVM 代码实现 通过本篇博客记录一下Stochastic Dual Coor ...

  7. 【Machine Learning 学习笔记】feature engineering中noisy feature的影响

    [Machine Learning 学习笔记]feature engineering中noisy feature的影响 通过本篇博客记录一下添加噪声对Lasso和SVM的影响,采用的数据集为sklea ...

  8. Andrew Ng Machine Learning 专题【Logistic Regression amp; Regularization】

    此文是斯坦福大学,机器学习界 superstar - Andrew Ng 所开设的 Coursera 课程:Machine Learning 的课程笔记. 力求简洁,仅代表本人观点,不足之处希望大家探 ...

  9. 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 17—Large Scale Machine Learning 大规模机器学习...

    Lecture17 Large Scale Machine Learning大规模机器学习 17.1 大型数据集的学习 Learning With Large Datasets 如果有一个低方差的模型 ...

  10. 【Machine Learning实验1】batch gradient descent(批量梯度下降) 和 stochastic gradient descent(随机梯度下降)

    批量梯度下降是一种对参数的update进行累积,然后批量更新的一种方式.用于在已知整个训练集时的一种训练方式,但对于大规模数据并不合适. 随机梯度下降是一种对参数随着样本训练,一个一个的及时updat ...

最新文章

  1. java 文件压缩 解压_Java文件压缩与解压缩(一)
  2. “AI赋能,驱动未来”—— 2018中国人工智能峰会(南京)圆满落幕
  3. 无冬连接不上账号服务器,电脑中玩无冬online掉线怎么回事_电脑中玩无冬online游戏总是掉线如何修复...
  4. Web应用扫描工具Wapiti
  5. Ansible自动化运维应用场景分析
  6. oracle as sydba,Oracle的操作系统认证(/ as sydba 登录方式)
  7. 力扣429. N 叉树的层序遍历(JavaScript)
  8. 瞬间几千次的重复提交,我用 SpringBoot+Redis 扛住了~
  9. 10x5 10x5用计算机记忆,第一章科学计算器使用
  10. 7 Papers Radios | 陈丹琦关系抽取新SOTA;上海交大医疗版MNIST数据集
  11. 但行好事 莫问前程 学习笔记
  12. 工具(6): 开发神器
  13. 如何在vmware中安装mac OS系统
  14. 滤镜怎么调好看?分享给图片调色的教程
  15. 遐想:Android Nexus One Flan
  16. 如何解决:ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
  17. 详解JQuery动画
  18. 数据科学家应当了解的五个统计基本概念
  19. 我们都只是一朵浮萍罢了
  20. 中文Analytics Intelligence 问答系统 (一)

热门文章

  1. 【移动前端】需要了解的HTML5 head 头标签
  2. 德国银杉(DETA)蓄电池/2VEG/2VEH/12VEL系列dryflex
  3. 车场网络信息集成管理系统服务器,IBMS智能化集成系统通用技术要求
  4. 数据透视表,一篇就够了
  5. Unity3d 获取场景中摄像头视频流,实现直播效果(无需代码)
  6. (跟我一起来学区块链(2.1))之区块链的组成原理(区块的组成和链式结构。)
  7. encodeURI()使用说明
  8. Xshell6 中文不限时版下载(免密匙)
  9. UG NX 12 基准点
  10. 如何快速搭建App系统-工具广告变现篇