% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make_partitions.R
\name{make_partitions}
\alias{make_partitions}
\title{Create Data Partitions Using Clustering}
\usage{
make_partitions(
  data,
  cluster_args,
  cluster_on_indicators,
  K,
  parallel,
  cl,
  do_not_cluster_on_these,
  neighbor_tolerance,
  standardize = TRUE,
  standardize_mode = "auto",
  dummy_adder = 0,
  dummy_dividor = 0
)
}
\arguments{
\item{data}{Numeric matrix of predictor variables (\strong{raw scale})}

\item{cluster_args}{Parameters for clustering}

\item{cluster_on_indicators}{Logical to include binary predictors}

\item{K}{Number of partitions minus 1 (\eqn{K})}

\item{parallel}{Logical to enable parallel processing}

\item{cl}{Cluster object for parallel computation}

\item{do_not_cluster_on_these}{Columns to exclude from clustering}

\item{neighbor_tolerance}{Scaling factor for neighbor detection}

\item{standardize}{Logical; whether to standardize data internally before
clustering.  Should equal \code{standardize_predictors_for_knots} from
\code{lgspline.fit}.  Default \code{TRUE}.}

\item{standardize_mode}{Character; \code{"auto"} (default) selects
\code{"minmax"} for a single effective clustering dimension and
\code{"normal"} for multiple dimensions.  Can be forced to either value.}

\item{dummy_adder}{Small constant added to numerator during standardization
to avoid exact-zero values (matches \code{lgspline.fit}'s
\code{dummy_adder}).  Default \code{0}.}

\item{dummy_dividor}{Small constant added to denominator during
standardization to avoid division by zero (matches
\code{lgspline.fit}'s \code{dummy_dividor}).  Default \code{0}.}
}
\value{
A list containing:
\describe{
  \item{centers}{Cluster center coordinates on the \strong{raw} scale.}
  \item{knots}{Knot points between centers on the \strong{raw} scale.}
  \item{assign_partition}{Function that accepts \strong{raw}-scale new data
    and returns integer-like partition assignments (0.5, 1.5, \ldots).}
  \item{neighbors}{List of neighboring partition indices.}
  \item{standardize_transf}{The forward standardization function used
    internally (for diagnostic use only).}
  \item{standardize_inv_transf}{The inverse standardization function
    (for diagnostic use only).}
  \item{centers_std}{Cluster centers on the standardized scale (for
    diagnostic use only).}
}
}
\description{
Partitions data support into clusters using Voronoi-like diagrams.
Standardization for clustering is handled internally; centers, knots, and
the returned \code{assign_partition} function are all on the **raw
(natural) scale** of the original predictors.
}
\keyword{internal}
