December 2018
Intermediate to advanced
318 pages
8h 28m
English
In statistics, the sum of squared errors is a method that measures the difference between the predicted value from the model and the actual value that has been noted. This is also known as the residual. For clustering, this is measured as the distance of the projected point from the center of the cluster.
We will be using the Euclidean distance, that is, the distance between two points in a straight line as a measure to compute the sum of the squared errors.
We define the Euclidean distance as follows:
def euclidean_distance_points(x1, x2): x3 = x1 - x2 return np.sqrt(x3.T.dot(x3))
We will call this preceding function to compute the error:
from operator import addtine1 = time.time()def ss_error(k_clusters, point): nearest_center ...
Read now
Unlock full access