% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ABCpp.R
\name{ABCpp.SingleInMultiple}
\alias{ABCpp.SingleInMultiple}
\title{Single-source Aggregating Bundles of Clusters (ABC), C++-accelerated engine}
\usage{
ABCpp.SingleInMultiple(
  data,
  distmeasure = "euclidean",
  weighting = "var",
  normalize = NULL,
  gr = c(),
  bag = TRUE,
  numsim = 1000,
  numvar = 100,
  linkage = "ward.D2",
  NC = NULL,
  mds = FALSE,
  nfeat = NULL,
  nugget_type = "between",
  nugget_args = list()
)
}
\arguments{
\item{data}{Numeric matrix with \strong{objects (samples) in rows} and
features in columns (the MosaiClusteR convention; transposed internally to
the features-by-objects layout of the original engine).}

\item{distmeasure}{Distance measure passed to \code{\link{Distance}}.}

\item{weighting}{\code{"var"}, \code{"cv"}, \code{"nugget"} or equal.}

\item{normalize}{Optional normalisation (see \code{\link{Normalization}}).}

\item{gr}{Unused; kept for interface compatibility.}

\item{bag}{Logical; bootstrap the objects each iteration (Step 2).}

\item{numsim}{Number of iterations \eqn{R}.}

\item{numvar}{Kept for backward compatibility; superseded by \code{nfeat}.}

\item{linkage}{Agglomeration method for \code{fastcluster::hclust}.}

\item{NC}{Base-cluster count (\code{NULL} = \eqn{\lfloor\sqrt{N}\rfloor}).}

\item{mds}{Unused placeholder.}

\item{nfeat}{Optional feature-subsample size. \code{NULL} (default) uses the
classic \eqn{g=\lfloor\sqrt{G}\rfloor}; a value \eqn{\ge 1} sets an absolute
count (raise it for low-dimensional sources where most features matter).}

\item{nugget_type, nugget_args}{Passed to the data-nugget weighting when
\code{weighting = "nugget"}.}
}
\value{
A data frame, \code{numsim} rows by one column per object; entries are
base-cluster labels (\code{0} = object not selected that iteration).
}
\description{
The canonical single-source ABC engine of
\insertCite{Amaratunga2008}{MosaiClusteR}. Over \code{numsim} iterations it
(optionally) bootstraps the objects, draws a weighted subsample of features,
clusters the sub-matrix with \code{fastcluster::hclust}, and records each
selected object's base-cluster label. \code{\link{M_ABCpp}} turns the stacked
label matrix into a consensus dissimilarity using the C++ co-clustering
kernel.
}
\section{Feature weighting (incl. data nuggets)}{

Features are subsampled with probability proportional to a rank-transformed
importance score:
\itemize{
\item \code{"var"} -- feature variance (the classic ABC choice);
\item \code{"cv"}  -- coefficient of variation;
\item \code{"nugget"} -- \emph{NEW}: the data-nugget between-group weighted
variance (\code{\link{create_data_nuggets}}), a robust, Big-Data-friendly
alternative to the raw variance;
\item anything else -- equal weights.
}
}

\examples{
data(mosaic_toy)
lab <- ABCpp.SingleInMultiple(mosaic_toy$List[[1]], numsim = 40, NC = 3,
                              weighting = "nugget")
dim(lab)
}
\references{
\insertAllCited{}
}
\seealso{
\code{\link{M_ABCpp}}, \code{\link{create_data_nuggets}}
}
