| Type: | Package | 
| Title: | Spectral Clustering for Mixed Type Data | 
| Version: | 1.0.2 | 
| Maintainer: | Cristina Tortora <grikris1@gmail.com> | 
| Description: | Performs cluster analysis of mixed-type data using Spectral Clustering, see F. Mbuga and, C. Tortora (2022) <doi:10.3390/stats5010001>. | 
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] | 
| Depends: | R (≥ 3.5) | 
| Imports: | RSpectra, cluster, ggplot2, GGally | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.1.2 | 
| NeedsCompilation: | no | 
| Packaged: | 2025-07-27 09:12:40 UTC; cristina | 
| Author: | Cristina Tortora | 
| Repository: | CRAN | 
| Date/Publication: | 2025-07-27 09:30:10 UTC | 
SpectralClMix
Description
Cluster analysis of mixed-type data using Spectral Clustering.
Author(s)
Felix Mbuga, Cristina Tortora, Zander Bonnet
References
F. Mbuga and, C. Tortora. Spectral Clustering of Mixed-Type Data. Stats, 5(1) 2022
Preforms spectral clustering on mix typed data
Description
Preforms spectral clustering of mix-type data
Usage
mspec(
  z,
  k = 2,
  sigma = c(20, 20),
  c_wt = NULL,
  starts = 10,
  its = 300,
  verbose = FALSE
)
Arguments
| 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 | 
Value
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 | 
References
F. Mbuga and, C. Tortora. Spectral Clustering of Mixed-Type Data. Stats, 5(1) 2022
Examples
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 mspec
Description
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
Usage
## S3 method for class 'SpectralClMixed'
plot(x,cols=NULL,...)
Arguments
| x | object of SpectralClMixed class, the output of mspec | 
| cols | For datasets with more than 10 columns, columns to plot | 
| ... | other graphic parameters | 
Value
No return value,the function produces a parallel coordinate plot and a scatter plot matrix
Examples
ex1=mspec(iris,3)
 plot(ex1,cols=1:4)Summarizes the output of mspec
Description
Summarizes the output of mspec
Usage
## S3 method for class 'SpectralClMixed'
summary(object,...)
Arguments
| object | object of SpectralClMixed class, the output of mspec | 
| ... | other optional parameters | 
Value
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.