Skip to content

Commit

Permalink
CEC samples
Browse files Browse the repository at this point in the history
  • Loading branch information
kudkudak committed Apr 30, 2015
1 parent dffe159 commit 00c8bb0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
19 changes: 19 additions & 0 deletions demo/samples/cec.T.dataset.R
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions demo/samples/cec.basic.R
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions demo/samples/cec.ellipse.R
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 00c8bb0

Please sign in to comment.