is.cl_partition(x)
is.cl_hard_partition(x)
is.cl_soft_partition(x)as.cl_partition(x)
as.cl_hard_partition(x)
For the coercion functions, a container object inheriting from
"cl_partition"
, with a suitable representation of the partition
given by x
.
is.cl_partition
and is.cl_hard_partition
are generic
functions. The methods provided in package
is.cl_soft_partition
gives true iff is.cl_partition
is
true and is.cl_hard_partition
is false.
as.cl_partition
returns an object of class
"cl_partition"
x
if
this already represents a partition (i.e., is.cl_partition(x)
is true), or the memberships obtained from x
via
as.cl_membership
.
as.cl_hard_partition(x)
returns an object which has class
"cl_hard_partition"
and inherits from "cl_partition"
,
and contains x
if it already represents a hard partition (i.e.,
is.cl_hard_partition(x)
is true), or the class ids obtained
from x
, using x
if this is an atomic vector of raw class
ids, or, if x
represents a soft partition or is a raw matrix of
membership values, using the class ids of the nearest hard
partition, defined by taking the class ids of the (first) maximal
membership values.
Conceptually, partitions and hard partitions are virtual classes, allowing for a variety of representations.
There are group methods for comparing partitions and computing their
minimum, maximum, and range based on the meet and join operations, see
cl_meet
.
data("Cassini")
pcl <- kmeans(Cassini$x, 3)
is.cl_partition(pcl)
is.cl_hard_partition(pcl)
is.cl_soft_partition(pcl)
Run the code above in your browser using DataLab