Skip to content

Commit

Permalink
Fix return type for get_medoids_final() and expose get_labels()
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaras committed Sep 16, 2023
1 parent 0560f35 commit 056651f
Show file tree
Hide file tree
Showing 24 changed files with 126 additions and 31 deletions.
2 changes: 1 addition & 1 deletion R_package/banditpam/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: banditpam
Title: Almost Linear-Time k-Medoids Clustering
Version: 1.0-1
Version: 1.0-2
Authors@R: c(person("Balasubramanian", "Narasimhan", role=c("aut", "cre"),
email = "[email protected]"),
person("Mo", "Tiwari", role=c("aut"),
Expand Down
5 changes: 5 additions & 0 deletions R_package/banditpam/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# banditpam 1.0-2

* Fixed up return type for `get_medoids_final()` method for medoid object
* Exposed `get_labels()` method for medoid object

# banditpam 1.0-1

* Typographical fixes
Expand Down
8 changes: 8 additions & 0 deletions R_package/banditpam/R/KMedoid.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ KMedoids <- R6::R6Class( "KMedoids"
}
,

#' @description
#' Return the cluster labels after clustering
#' @return a vector of the cluster labels for the observations
get_labels = function() {
.Call('_banditpam_KMedoids__get_labels', PACKAGE = 'banditpam', private$xptr)
}
,

#' @description
#' Get the specified statistic after clustering
#' @param what a string which should one of `"dist_computations"`, `"dist_computations_and_misc"`,
Expand Down
4 changes: 4 additions & 0 deletions R_package/banditpam/R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ bpam_num_threads <- function() {
.Call('_banditpam_KMedoids__get_medoids_final', PACKAGE = 'banditpam', xp)
}

.KMedoids__get_labels <- function(xp) {
.Call('_banditpam_KMedoids__get_labels', PACKAGE = 'banditpam', xp)
}

.KMedoids__get_k <- function(xp) {
.Call('_banditpam_KMedoids__get_k', PACKAGE = 'banditpam', xp)
}
Expand Down
4 changes: 3 additions & 1 deletion R_package/banditpam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here's a BibTeX entry:

## Installation

`banditpam` can be installed from CRAN like any other package.
`banditpam` can be installed from CRAN like any other package.

## Example

Expand All @@ -43,6 +43,8 @@ meds <- obj$get_medoids_final()
## Plot the results
plot(X[, 1], X[, 2])
points(X[meds, 1], X[meds, 2], col = "red", pch = 19)
## Retrieve cluster labels
clusters <- obj$get_labels()
##
## One can query some statistics too; see help("KMedoids")
##
Expand Down
2 changes: 1 addition & 1 deletion R_package/banditpam/docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R_package/banditpam/docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R_package/banditpam/docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions R_package/banditpam/docs/articles/kmediods.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions R_package/banditpam/docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion R_package/banditpam/docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions R_package/banditpam/docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions R_package/banditpam/docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pandoc: 3.1.1
pandoc: 3.1.7
pkgdown: 2.0.7
pkgdown_sha: ~
articles:
kmediods: kmediods.html
last_built: 2023-03-14T18:31Z
last_built: 2023-09-16T00:52Z

2 changes: 1 addition & 1 deletion R_package/banditpam/docs/reference/BanditPAM-package.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions R_package/banditpam/docs/reference/KMedoids.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R_package/banditpam/docs/reference/bpam_num_threads.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R_package/banditpam/docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 056651f

Please sign in to comment.