| nTARP | R Documentation |
Implements the n-TARP clustering technique by projecting the data into a one-dimensional space and performing k-means. The data can be either unlabeled or labeled. The only required parameters are the number of projections and the within-cluster sum of squares threshold. Suggested starting values: 'number_of_projections = 1000' and 'withinss_threshold = 0.36'.
nTARP(data, number_of_projections, withinss_threshold, ids = NULL)
data |
Numeric matrix — dataset to be clustered using 'nTARP' |
number_of_projections |
Numeric — number of random projections for 'nTARP' to try for each run |
withinss_threshold |
Numeric — maximum value defining what a "quality cluster" is, based on the solution's normalized within-cluster sum of squares (typically 0.36) |
ids |
Numeric or character vector — identifying labels for individuals in the clusters |
A list containing results and supporting data from the k-means clustering analysis: (1) 'OptimalSolution': the optimal clustering solution, including cluster assignments and centroids, (2) 'OptimalProjection': the projection vector associated with the optimal solution, (3) 'Threshold': the threshold used for determining cluster membership or filtering, (4) 'Direction': indicates where a new data point should be placed if using the result as a classifier, (5) 'OptimalWithinss': the within-cluster sum of squares for the optimal solution, (6) 'AllWithinss': the within-cluster sum of squares for all candidate solutions, (7) 'Clusterings': all clustering solutions generated during analysis, (8) 'OriginalData': the original dataset used for clustering, (9) 'OriginalIDs': the identifiers of the original observations.
Tarun, Y.; Boutin, M. (2018). n-TARP Binary Clustering Code. Purdue University Research Repository. doi:10.4231/R74B2ZJV
data <- data.frame(X1 = c(0.5, -0.2, 0.1, 5.2, 4.8, 5.1, -4.5, -5.2, -4.8, -5.1),
X2 = c(0.3, -0.1, 0.2, 5.0, 4.9, 5.3, 5.0, 5.2, 4.7, 4.9),
X3 = c(0.4, 0.0, 0.1, 5.1, 4.7, 5.2, -5.0, -4.8, -5.3, -5.1))
result <- nTARP(data = data,number_of_projections = 100,withinss_threshold = 0.36)
str(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.