शुरू करेंमुफ़्त में शुरू करें

kNN distance matrix

The kNN distance matrix is a necessary prior step to producing the kNN distance score. The distance matrix has

  • \(n\) rows, where \(n\) is the number of data points
  • \(k\) columns, where \(k\) is the user-chosen number of neighbors.

The entry in row i and column j of the distance matrix is the distance between point i and its jth nearest neighbor.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Introduction to Anomaly Detection in R

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Calculate the 5 nearest neighbors distance
wine_nn <- get.knn(wine, k = ___)

# View the distance matrix
head(___$___)
कोड संपादित करें और चलाएँ