Performs splines clustering using K-means

# S4 method for Moanin
splines_kmeans(
  object,
  n_clusters = 10,
  init = "kmeans++",
  n_init = 10,
  max_iter = 300,
  random_seed = .Random.seed[1],
  fit_splines = TRUE,
  rescale = TRUE
)

Arguments

object

An object of class Moanin, an object containing all related information for time course data and the splines model that will be used (if applicable). See create_moanin_model for more details.

n_clusters

int optional, default: 10

init

["kmeans++", "random", "optimal_init"]

n_init

int, optional, default: 10 Number of initialization to perform.

max_iter

int, optional, default: 300 Maximum number of iteration to perform

random_seed

int, optional, default: NULL. Passed to argument seed in KMeans_rcpp. If NULL (default), set to .Random.seed[1].

fit_splines

boolean, optional, default: TRUE Whether to fit splines or not.

rescale

boolean, optional, default: TRUE Whether to rescale the data or not.

Value

A list in the format returned by KMeans_rcpp, with the following elements added or changed:

  • centroids The centroids are rescaled so that they range from 0-1

  • fit_splines Logical, the value of fit_splines given to the function

  • rescale The value of rescale given to the function

Details

If Moanin object's slot has log_transform=TRUE, then the data will be transformed by the function log(x+1) before applying splines and clustering.

Examples

data(exampleData) # Use the default options moanin <- create_moanin_model(data=testData, meta=testMeta) out <- splines_kmeans( moanin,n_clusters=5) table(out$clusters)
#> #> 1 2 3 4 5 #> 74 108 108 107 103