Implementing Minkowski Distance Metric | Challenge

# Introduction In unsupervised learning, the labels of training samples are unknown, and the goal is to reveal the intrinsic properties and patterns of the data through learning from unlabeled training samples. The most widely studied task in this type of learning is clustering. The clustering task attempts to divide the samples in the dataset into several disjoint subsets, each subset is called a cluster. So, what makes a good clustering result? Intuitively, we hope that things of the same kind are grouped together, which means the samples within the same cluster should be as similar as possible, and the samples between different clusters should be as dissimilar as possible. In other words, a good clustering result should have high intra-cluster similarity and low inter-cluster similarity. How can we calculate similarity? In fact, each sample can be seen as a point in space, and the sample set is a collection of points in space, so we can use distance to calculate the similarity between points: the closer two points are, the higher their similarity; the farther away, the lower their similarity. In this challenge, we will be calculating the Minkowski distance between two samples. The Minkowski distance is a metric used to measure the similarity between two points in space. It is defined by a parameter "p" which determines the type of Minkowski distance to be calculated. We will be implementing a function that takes two samples and the value of "p", and returns the Minkowski distance between them.

|
60 : 00

Click the virtual machine below to start practicing