Skip to content

Commit

Permalink
fixing CRAN issues
Browse files Browse the repository at this point in the history
  • Loading branch information
azureblue committed Sep 21, 2021
1 parent d0ef6b4 commit 047f2b1
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 35 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Package: CEC
Title: Cross-Entropy Clustering
Version: 0.10.3
Date: 2021-09-17
Date: 2021-09-20
Author: Konrad Kamieniecki [aut, cre], Przemyslaw Spurek [ctb]
Maintainer: Konrad Kamieniecki <[email protected]>
Description: CEC divides data into Gaussian type clusters. The implementation allows the simultaneous use of various type Gaussian mixture models, performs the reduction of unnecessary clusters and it's able to discover new groups. Based on Spurek, P. and Tabor, J. (2014) <doi:10.1016/j.patcog.2014.03.006>.
Description: Clustering that splits data into Gaussian type clusters. The implementation allows the simultaneous use of various type Gaussian mixture models, performs the reduction of unnecessary clusters and it's able to discover new groups. Based on Spurek, P. and Tabor, J. (2014) <doi:10.1016/j.patcog.2014.03.006>.
ByteCompile: true
URL: https://github.com/azureblue/cec
Encoding: UTF-8
NeedsCompilation: yes
SystemRequirements: C++11
License: GPL-3
Imports: graphics, methods, stats, utils
Packaged: 2021-09-20 21:50:01 UTC; konrad
14 changes: 7 additions & 7 deletions R/cec.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ cec <- function(
param,
centers.init = c("kmeans++", "random"),
card.min = "5%",
keep.removed = F,
interactive = F,
keep.removed = FALSE,
interactive = FALSE,
threads = 1,
split = F,
split = FALSE,
split.depth = 8,
split.tries = 5,
split.limit = 100,
split.initial.starts = 1,
readline = T
readline = TRUE
)
{
# check arguments
Expand Down Expand Up @@ -207,13 +207,14 @@ cec.interactive <- function(
param,
centers.init = c("kmeans++", "random"),
card.min = "5%",
keep.removed = F,
readline = T
keep.removed = FALSE,
readline = TRUE
)
{
par
{
old.ask = par()["ask"]
on.exit(par(old.ask))
n = ncol(x)
if (n != 2)
stop("interactive mode available only for 2-dimensional data")
Expand Down Expand Up @@ -261,7 +262,6 @@ cec.interactive <- function(
i = i + 1
}
plot(Z, ellipses="TRUE")
par(ask = old.ask)
if (readline)
ignore = readline(prompt="Press <Enter>:")

Expand Down
4 changes: 2 additions & 2 deletions R/plot.cec.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plot.cec <- function(x, col, cex = 0.5, pch = 19, cex.centers = 1, pch.centers = 8, ellipses.lwd = 4, ellipses = TRUE, model = T, xlab, ylab, ...)
plot.cec <- function(x, col, cex = 0.5, pch = 19, cex.centers = 1, pch.centers = 8, ellipses.lwd = 4, ellipses = TRUE, model = TRUE, xlab, ylab, ...)
{
if (ncol (x $ data) != 2 )
stop("plotting available only for 2-dimensional data")
Expand Down Expand Up @@ -45,4 +45,4 @@ plot.cec <- function(x, col, cex = 0.5, pch = 19, cex.centers = 1, pch.centers =
finally = {})
}
}
}
}
10 changes: 9 additions & 1 deletion man/CEC-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ Konrad Kamieniecki
\seealso{
\code{\link{cec}}
}
\keyword{ clustering, entropy, gaussian, kmeans }
\keyword{cluster}
\keyword{models}
\keyword{multivariate}
\keyword{package}
\concept{entropy}
\concept{gaussian}
\concept{gaussian mixture models}
\concept{kmeans}
4 changes: 1 addition & 3 deletions man/ball.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@ M = ball(4000, 0.9)
plot(M, cex = 0.5, pch = 19)
}

\keyword{ ~ball }
\keyword{ ~points }
\keyword{ ~uniform }
\keyword{datagen}
23 changes: 16 additions & 7 deletions man/cec.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Performs Cross-Entropy Clustering on a data matrix.
\usage{
cec(x, centers, type = c("covariance", "fixedr", "spherical", "diagonal",
"eigenvalues", "mean", "all"), iter.max = 25, nstart = 1, param,
centers.init = c("kmeans++", "random"), card.min = "5\%", keep.removed = F,
interactive = F, threads = 1, split = F, split.depth = 8, split.tries = 5,
split.limit = 100, split.initial.starts = 1,readline = T)
centers.init = c("kmeans++", "random"), card.min = "5\%", keep.removed = FALSE,
interactive = FALSE, threads = 1, split = FALSE, split.depth = 8, split.tries = 5,
split.limit = 100, split.initial.starts = 1, readline = TRUE)
}

\arguments{
Expand Down Expand Up @@ -56,7 +56,7 @@ only if the \code{centers} argument is a number or a vector.
If the \code{centers} argument is a vector, \code{length(centers)} clusterings will be performed
for each start and the total number of clusterings will be \code{length(centers) * nstart}.

If the split mode is on (\code{split = T}), it's rarely desired use change this parameter as the whole procedure (initial clustering + split) will be performed \code{nstart} times.
If the split mode is on (\code{split = TRUE}), it's rarely desired use change this parameter as the whole procedure (initial clustering + split) will be performed \code{nstart} times.
}
\item{centers.init}{
Expand Down Expand Up @@ -182,7 +182,8 @@ m2 = matrix(rnorm(2000, mean = 3, sd = 1.5), ncol = 2)
m3 = matrix(rnorm(2000, mean = 3, sd = 1), ncol = 2)
m3[,2] = m3[,2] - 5
m = rbind(m1, m2, m3)
par(ask = TRUE)
oldpar = par(ask = TRUE)
on.exit(par(oldpar))
plot(m, cex = 0.5, pch = 19)
## Clustering result:
Z = cec(m, 10, iter.max = 100, card.min="7\%")
Expand Down Expand Up @@ -223,5 +224,13 @@ Spurek, P. and Tabor, J. (2014)
Cross-Entropy Clustering
\emph{Pattern Recognition} \bold{47, 9} 3046--3059
}
\keyword{ ~cec }
\keyword{ ~clustering }
\keyword{cluster}
\keyword{models}
\keyword{multivariate}
\keyword{package}
\concept{entropy}
\concept{gaussian}
\concept{gaussian mixture models}
\concept{kmeans}
5 changes: 1 addition & 4 deletions man/mouseset.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,4 @@ right.ear.dist=2.5, dim=2)
plot(M, cex = 0.5, pch = 19)
}

\keyword{ ~mouse}
\keyword{ ~mouseset}
\keyword{ ~points}
\keyword{ ~uniform}
\keyword{datagen}
8 changes: 5 additions & 3 deletions man/plot.cec.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Ellipses are drawn with regards to the covariance (either model or sample) of ea

\usage{
\method{plot}{cec}(x, col, cex = 0.5, pch = 19, cex.centers = 1, pch.centers = 8,
ellipses.lwd = 4, ellipses = TRUE, model = T, xlab, ylab, ...)
ellipses.lwd = 4, ellipses = TRUE, model = TRUE, xlab, ylab, ...)
}

\arguments{
Expand Down Expand Up @@ -67,6 +67,8 @@ Arguments are passed to \code{plot} function when drawing data points.
}
}

\value{No return value.}

\seealso{
\code{\link{print.cec}}
}
Expand All @@ -75,5 +77,5 @@ Arguments are passed to \code{plot} function when drawing data points.
## See the examples of function cec.
}

\keyword{ ~plot }
\keyword{ ~cec }
\keyword{hplot}

5 changes: 2 additions & 3 deletions man/print.cec.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ Ignored.
}
}

\value{Returns the summary of the \code{cec} function result as text.}

\seealso{
\code{\link{plot.cec}}
}

\examples{
## See the examples of function cec.
}

\keyword{ ~print }
\keyword{ ~cec }
5 changes: 2 additions & 3 deletions man/run.cec.tests.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ defining each test case. This is also used for R CMD check.
run.cec.tests()
}

\keyword{ ~tests }
\keyword{ ~unit }
\keyword{ ~cec }
\value{No return value. Stops with error when a test fails.}
\concept{unit testing}

0 comments on commit 047f2b1

Please sign in to comment.