Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Finish the matlab function to implement k means below, where X in the parameters is random data imported from a .dat file, idx is data

Finish the matlab function to implement k means below, where X in the parameters is random data imported from a .dat file, idx is data points assigned to nearest centroid, k = 5. The function updateCentroids should re-compute the cluster centroids by using the mean of all the data points in each cluster and assign the calculated mean as new centroid of the cluster.:

image text in transcribed

function centroids = updateCentroids (X, idx, K) [m n] = size(X); centroids = zeros (K, n); for i=1:6 % you code here end function centroids = updateCentroids (X, idx, K) [m n] = size(X); centroids = zeros (K, n); for i=1:6 % you code here end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago