diff --git a/demo/samples/cec.T.dataset.R b/demo/samples/cec.T.dataset.R new file mode 100644 index 00000000..d503c6aa --- /dev/null +++ b/demo/samples/cec.T.dataset.R @@ -0,0 +1,19 @@ +#' --- +#' title: "Pick types of clusters in CEC" +#' author: "" +#' date: "" +#' output: +#' html_document: +#' self_contained: false +#' --- + +library(gmum.r) + +data(cec_ts) +standard_cluster_param = list(method.type = "standard") +spherical_cluster_param = list(method.type = "sphere") +diagonal_cluster_param = list(method.type = 'diagonal') + +c <- CEC(x = Tset, k = 4, params.mix = list(standard_cluster_param, spherical_cluster_param, diagonal_cluster_param, diagonal_cluster_param), control.nstart = 100, control.eps=0.09) + +plot(c, ellipses = TRUE, centers = TRUE) \ No newline at end of file diff --git a/demo/samples/cec.basic.R b/demo/samples/cec.basic.R new file mode 100644 index 00000000..fb155785 --- /dev/null +++ b/demo/samples/cec.basic.R @@ -0,0 +1,20 @@ +#' --- +#' title: "Basic clustering of mouse dataset using CEC" +#' author: "" +#' date: "" +#' output: +#' html_document: +#' self_contained: false +#' --- + +library(gmum.r) + +# Fitting to mouse like dataset +data(cec_mouse_1_spherical) +plot(cec.mouse1spherical, main="Mouse-like dataset") + +# Fit spherical gaussians to the dataset +cec <- CEC(k=3, x=cec.mouse1spherical, control.nstart=10, method.type="sphere") + +# Plot results +plot(cec, centers=TRUE, ellipses=TRUE) \ No newline at end of file diff --git a/demo/samples/cec.ellipse.R b/demo/samples/cec.ellipse.R new file mode 100644 index 00000000..cda70136 --- /dev/null +++ b/demo/samples/cec.ellipse.R @@ -0,0 +1,20 @@ +#' --- +#' title: "Fit any gauss family to dataset in CEC" +#' author: "" +#' date: "" +#' output: +#' html_document: +#' self_contained: false +#' --- + + +library(gmum.r) +data(cec_ellipse_gauss) + +# Try to fit 5 gaussians to the dataset +cec <- CEC(k=5, x=cec.ellipsegauss, method.init="random") + +# Note that we set 5 cluster. Only 4 was needed. +plot(cec, centers=TRUE, ellipses=TRUE) +summary(cec) +