Fitness function with automatic pattern selection per Simplivariate Component
fitness(
string,
df,
dfMean,
penalty,
patternFunctions = defaultPatternFunctions(),
returnPatterns = FALSE,
...
)Either total fitness (numeric), or list(fitness, componentPatterns) if returnPatterns = TRUE.
Vector with length nrow(df) + ncol(df): component labels for rows and columns (in this order).
Numeric matrix: full data.
Scalar: global mean of df.
Named vector with penalty weights per pattern.
Named list of functions returning pattern-based approximations.
Logical: if TRUE, also returns chosen pattern per component.
Additional arguments passed to the GA functions