Package {pfclust}


Type: Package
Title: Power Fuzzy Clustering and Cluster-Wise Regression
Version: 0.1.1
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>.
License: MIT + file LICENSE
Encoding: UTF-8
Depends: R (≥ 3.5.0)
Imports: stats
Suggests: flexCWM
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-07-13 21:04:38 UTC; cristina
Author: Phuc Thinh Nguyen [aut, cre], Cristina Tortora [aut, ths, dgs], Antonio Punzo [aut, ths, dgs]
Maintainer: Phuc Thinh Nguyen <phucthinh010603@yahoo.com>
Repository: CRAN
Date/Publication: 2026-07-13 21:50:02 UTC

pfclust: Power Fuzzy Clustering and Cluster-wise Regression

Description

Implements Power Fuzzy Clustering (PFC) and Power Fuzzy Cluster-wise Regression (PFCR) with Minkowski and adaptive regularised Mahalanobis distances.

Details

The two main user-facing functions are:

Author(s)

Maintainer: Phuc Thinh Nguyen phucthinh010603@yahoo.com

Authors:


Power Fuzzy Clustering

Description

Clusters the rows of 'Y' into 'K' groups using Minkowski, adaptive regularised Mahalanobis, or Euclidean distance.

Usage

PFC(
  Y,
  K,
  m = 2,
  q = 2,
  distance = "Euclidean",
  p = 2,
  alpha = 0.5,
  beta = 10^15,
  threshold = 0.01,
  max.iter = 100
)

Arguments

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'.

Value

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'.

Examples

res <- PFC(iris[, 1:4], K = 3)
table(res$l, iris[, 5])


Power Fuzzy Cluster-wise Regression

Description

Fits 'K' cluster-specific linear models Y = X B_k + \varepsilon, selecting an internal solver based on the chosen distance and exponent.

Usage

PFCR(
  X,
  Y,
  K,
  m = 2,
  q = 2,
  distance = "Euclidean",
  p = 2,
  alpha = 0.5,
  beta = 10^15,
  threshold = 0.01,
  max.iter = 100
)

Arguments

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'.

Value

A list with elements:

B

Array of regression coefficients.

d

Data frame of distances ('n x K').

p

Data frame of membership degrees ('n x K').

JDF

Vector of objective-function values per iteration.

l

Hard cluster labels (length 'n').

rho, cov

(Mahalanobis only) cluster proportions and covariance matrices.

Examples

## 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)