get_centers: Get Centers for Partitioning

View source: R/make_partitions.R

get_centersR Documentation

Get Centers for Partitioning

Description

Get Centers for Partitioning

Usage

get_centers(
  data,
  K,
  cluster_args,
  cluster_on_indicators,
  data_already_processed = FALSE
)

Arguments

data

Matrix of predictor data (already processed: binary/excluded columns zeroed out by the caller when data_already_processed = TRUE)

K

Number of partitions minus 1 (K)

cluster_args

List with custom centers and kmeans args

cluster_on_indicators

Include binary predictors in clustering

data_already_processed

Logical; when TRUE the caller has already zeroed out binary / excluded columns, so get_centers skips its own binary-zeroing step. Defaults to FALSE for backward compatibility.

Details

Returns partition centers via:

1. Custom supplied centers if provided as a valid (K+1) \times q matrix

2. kmeans clustering on all non-spline variables if cluster_on_indicators=TRUE or if data_already_processed=TRUE

3. kmeans clustering excluding binary variables if cluster_on_indicators=FALSE and data_already_processed=FALSE

Value

Matrix of cluster centers


lgspline documentation built on May 8, 2026, 5:07 p.m.