| Title: | Power Fuzzy Clustering and Cluster-Wise Regression |
|---|---|
| Description: | Implementations of Power Fuzzy Clustering (PFC) and Power Fuzzy Cluster-wise Regression (PFCR) for multivariate data. The package supports Minkowski distances, with the L1 case solved via iteratively re-weighted least squares and the case p > 1 solved via coordinate-wise root finding, as well as an adaptive, regularised Mahalanobis distance with per-cluster covariance matrices. Both plain fuzzy clustering and cluster-wise linear regression are provided. The corresponding paper can be found at Nguyen P.T., Tortora C., and Punzo A. (2026) <doi:10.1109/TFUZZ.2026.3683998>. |
| Authors: | Phuc Thinh Nguyen [aut, cre], Cristina Tortora [aut, ths, dgs], Antonio Punzo [aut, ths, dgs] |
| Maintainer: | Phuc Thinh Nguyen <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-07-13 23:40:06 UTC |
| Source: | https://github.com/cran/pfclust |
Clusters the rows of 'Y' into 'K' groups using Minkowski, adaptive regularised Mahalanobis, or Euclidean distance.
PFC( Y, K, m = 2, q = 2, distance = "Euclidean", p = 2, alpha = 0.5, beta = 10^15, threshold = 0.01, max.iter = 100 )PFC( Y, K, m = 2, q = 2, distance = "Euclidean", p = 2, alpha = 0.5, beta = 10^15, threshold = 0.01, max.iter = 100 )
Y |
An 'n x dy' data frame or matrix of observations. |
K |
Number of clusters (positive integer). |
m |
Fuzzifier, must be strictly greater than 1. Default '2'. |
q |
Distance exponent, must be strictly greater than 0. Default '2'. |
distance |
One of '"Minkowski"', '"Mahalanobis"', or '"Euclidean"'. Default '"Euclidean"'. |
p |
Minkowski exponent ('>= 1'). Ignored when 'distance' is '"Mahalanobis"' or '"Euclidean"'. Default '2'. |
alpha |
Regularisation weight for the Mahalanobis covariance. Default '0.5'. |
beta |
Eigenvalue ratio bound for the Mahalanobis covariance. Default '1e15'. |
threshold |
Convergence tolerance. Default '0.01'. |
max.iter |
Maximum number of iterations. Default '100'. |
A list with elements 'B' (or 'C') for cluster centres, 'd' (distances), 'p' (memberships), 'JDF' (objective history), and 'l' (hard labels). For Mahalanobis, also 'rho' and 'cov'.
res <- PFC(iris[, 1:4], K = 3) table(res$l, iris[, 5])res <- PFC(iris[, 1:4], K = 3) table(res$l, iris[, 5])
Fits 'K' cluster-specific linear models ,
selecting an internal solver based on the chosen distance and exponent.
PFCR( X, Y, K, m = 2, q = 2, distance = "Euclidean", p = 2, alpha = 0.5, beta = 10^15, threshold = 0.01, max.iter = 100 )PFCR( X, Y, K, m = 2, q = 2, distance = "Euclidean", p = 2, alpha = 0.5, beta = 10^15, threshold = 0.01, max.iter = 100 )
X |
An 'n x dx' data frame or matrix of covariates. |
Y |
An 'n x dy' data frame or matrix of dependent variables. |
K |
Number of clusters (positive integer). |
m |
Fuzzifier, must be strictly greater than 1. Default '2'. |
q |
Distance exponent, must be strictly greater than 0. Default '2'. |
distance |
One of '"Minkowski"', '"Mahalanobis"', or '"Euclidean"'. Default '"Euclidean"'. |
p |
Minkowski exponent ('>= 1'). Ignored when 'distance' is '"Mahalanobis"' or '"Euclidean"'. Default '2'. |
alpha |
Regularisation weight for the Mahalanobis covariance. Default '0.5'. |
beta |
Eigenvalue ratio bound for the Mahalanobis covariance. Default '1e15'. |
threshold |
Convergence tolerance on successive coefficient updates. Default '0.01'. |
max.iter |
Maximum number of iterations. Default '100'. |
A list with elements:
Array of regression coefficients.
Data frame of distances ('n x K').
Data frame of membership degrees ('n x K').
Vector of objective-function values per iteration.
Hard cluster labels (length 'n').
(Mahalanobis only) cluster proportions and covariance matrices.
## Not run: library(flexCWM) data("students") Y <- students[, 2:3] X <- students[, 4] res <- PFCR(X, Y, K = 2, distance = "Mahalanobis") table(res$l, students[, 1]) ## End(Not run)## Not run: library(flexCWM) data("students") Y <- students[, 2:3] X <- students[, 4] res <- PFCR(X, Y, K = 2, distance = "Mahalanobis") table(res$l, students[, 1]) ## End(Not run)