# pfclust

Power Fuzzy Clustering (PFC) and Power Fuzzy Cluster-wise Regression (PFCR)
in R, with Minkowski distances (`p = 1` via IRLS, `p > 1` via coordinate-wise
root finding) and an adaptive, regularised Mahalanobis distance.

## Installation

```r
# from a local clone
devtools::install("path/to/pfclust")
```

## Usage

```r
library(pfclust)

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

# Cluster-wise regression
library(flexCWM)
data("students")
res <- PFCR(students[, 4], students[, 2:3], K = 2, distance = "Mahalanobis")
table(res$l, students[, 1])
```

See `inst/examples/demo.R` for a full walkthrough.

## Regenerating documentation

The `NAMESPACE` and `man/*.Rd` files in this repo were written to match what
`roxygen2` produces. To regenerate them from the roxygen comments:

```r
devtools::document()
```
