## K- Means Clustering
* Implement the k-means clustering algorithm with number of clusters are given to be 3,5 and 7.
* Here first we randomly select the centroids from the given data set. Then we use the simple Euclidean distance to calculate the distance between the each data sample and all the centroids selected.
* We then select the cluster which has the minimum distance to the data sample and classify that data value to that cluster.
* We do this for all the data sample in the data set. Then we recalculate the centroid values. We do this by taking mean of the entire data sample in that particular cluster and make it the new centroid.
* Again we repeat the steps until the below conditions is met. During each iteration, we make a note of sum of squared errors (SSE) of distances of samples from the centroids.
* We stop the iterations when the change in the SSE of consecutive iterations is less than 0.001 or if number of iterations reach 100. We used ‘pdist2’ for calculating the Euclidean distance.
## Ensemble Classification model
There are 4 parts to this problem. The data set contains images of handwritten digits. We need to classify the data samples and also report the accuracy of each models.
* First we use the k-nearest neighbor with k=7
* We developed a SVM model with a Polynomial Kernel of degree2. We used the same code that we developed for previous assignment
* We developed a Feedforward neural network with a single hidden layer with 25 neurons
* We used all the above algorithms to predict the data sample by ensemble method in which we classify a data sample by taking majority vote of the classes predicted using all the above algorithms
K-Means 集成,实现 k 均值聚类算法,将聚类数指定为 3、5 和 7
版权申诉
197 浏览量
2022-06-24
10:09:53
上传
评论
收藏 2KB ZIP 举报
工藤新一11111
- 粉丝: 7
- 资源: 15
最新资源
- Python爬取大众点评数据.zip
- 计算机视觉(CV)open CV 人脸识别程序.docx
- python 端午节游戏,选择三个传统的端午节活动之一:包粽子、赛龙舟或挂艾草 根据玩家的选择,游戏会描述相应的情节,并在完成后
- C语言各版块实验题库、实验汇报以及实验教学案例资源
- 数据库连接(MySQL与VS2022)_vs2022 mysql-CSDN博客 (2024_6_1 19_11_34).html
- Flappy bird小游戏
- 数电实验五:555单稳态触发电路、555单稳态触发电路、555构成的施密特触发器
- MySQLTuner,一个用Perl编写的脚本,它允许你快速审查MySQL安装情况,并进行调整以提高性能和稳定性
- 冒泡排序 基础排序 插入排序 快速排序 双路快速排序 三路快速排序 堆排序.zip
- 数电实验四:加法计数器、减法计数器、加法器、建议数字钟、74LS192功能测试
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈