Title: | Spectral Clustering for Mixed Type Data |
---|---|
Description: | Performs cluster analysis of mixed-type data using Spectral Clustering, see F. Mbuga and, C. Tortora (2022) <doi:10.3390/stats5010001>. |
Authors: | Cristina Tortora [aut, cre, cph] , Felix Mbuga [aut], Zander Bonnet [aut] |
Maintainer: | Cristina Tortora <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.1 |
Built: | 2024-11-23 06:36:45 UTC |
Source: | CRAN |
Preforms spectral clustering of mix-type data
mspec( z, k = 2, sigma = c(20, 20), c_wt = NULL, starts = 10, its = 300, verbose = FALSE )
mspec( z, k = 2, sigma = c(20, 20), c_wt = NULL, starts = 10, its = 300, verbose = FALSE )
z |
data to be clustered |
k |
the number of clusters. |
sigma |
vector of lower,upper bounds for sigma |
c_wt |
the category weights, is assigned to c(0.9999, 0.999, .99, seq(0.95, 0.05,-0.05), .01, 0.001, 0.0001) if null. |
starts |
the number of random starts |
its |
the max number of iterations for the kmeans algorithm |
verbose |
if you would like printed output during running of function |
A class SpectralClMixed list with components
ct_wt |
the selected category weight |
bt/wt_ss |
the between divided by the within sum of squares |
tot_wt_ss |
the total within sum of squares |
cluster |
the cluster assignments |
data |
the original data |
F. Mbuga and, C. Tortora. Spectral Clustering of Mixed-Type Data. Stats, 5(1) 2022
c1=data.frame(v1=rnorm(30,0),v2=rnorm(30,0),v3=factor(round(runif(30))+1)) c2=data.frame(v1=rnorm(30,2),v2=rnorm(30,4),v3=factor(round(runif(30))+4)) data=rbind(c1,c2) res=mspec(data, k = 2) summary(res) plot(res)
c1=data.frame(v1=rnorm(30,0),v2=rnorm(30,0),v3=factor(round(runif(30))+1)) c2=data.frame(v1=rnorm(30,2),v2=rnorm(30,4),v3=factor(round(runif(30))+4)) data=rbind(c1,c2) res=mspec(data, k = 2) summary(res) plot(res)
Plots the output of the function mspec, which performs Spectral clustering for mixed type data. The function displays up to 10 variables on a parrallel coordinate plot and on a scatter plot matrix, with colors representing the clustering partition
## S3 method for class 'SpectralClMixed' plot(x,cols=NULL,...)
## S3 method for class 'SpectralClMixed' plot(x,cols=NULL,...)
x |
object of SpectralClMixed class, the output of mspec |
cols |
For datasets with more than 10 columns, columns to plot |
... |
other graphic parameters |
No return value,the function produces a parallel coordinate plot and a scatter plot matrix
ex1=mspec(iris,3) plot(ex1,cols=1:4)
ex1=mspec(iris,3) plot(ex1,cols=1:4)
Cluster analysis of mixed-type data using Spectral Clustering.
Felix Mbuga, Cristina Tortora, Zander Bonnet
F. Mbuga and, C. Tortora. Spectral Clustering of Mixed-Type Data. Stats, 5(1) 2022
Summarizes the output of mspec
## S3 method for class 'SpectralClMixed' summary(object,...)
## S3 method for class 'SpectralClMixed' summary(object,...)
object |
object of SpectralClMixed class, the output of mspec |
... |
other optional parameters |
It displays: The selected categorical variables weight, The between divided by within sum of squares, The total within sum of squares, and the cluster size.