Skip to content

Commit

Permalink
version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Alfons authored and gaborcsardi committed Feb 13, 2012
1 parent 9eaf875 commit c2957d5
Show file tree
Hide file tree
Showing 43 changed files with 2,062 additions and 1,220 deletions.
23 changes: 12 additions & 11 deletions DESCRIPTION
@@ -1,20 +1,21 @@
Package: cvTools
Type: Package
Title: Cross-validation tools for regression models
Version: 0.1.1
Date: 2011-12-07
Version: 0.2.0
Date: 2012-02-13
Author: Andreas Alfons
Maintainer: Andreas Alfons <andreas.alfons@econ.kuleuven.be>
Depends: R (>= 2.11.0), lattice, robustbase
Description: Tools that allow developers to write functions
for cross-validation with minimal programming effort
and assist users with model selection.
Imports: lattice, robustbase, stats
Description: Tools that allow developers to write functions for
cross-validation with minimal programming effort and assist
users with model selection.
License: GPL (>= 2)
LazyLoad: yes
Collate: 'accessors.R' 'aggregate.R' 'bwplot.R' 'cost.R' 'cvExamples.R'
'cvFit.R' 'cvFolds.R' 'cvReshape.R' 'cvSelect.R' 'cvTool.R'
'cvTuning.R' 'densityplot.R' 'dotplot.R' 'plot.R' 'print.R'
'subset.R' 'summary.R' 'utils.R' 'xyplot.R'
Packaged: 2011-12-07 00:15:47 UTC; andi
Collate: 'accessors.R' 'aggregate.R' 'bwplot.R' 'cost.R' 'cvFit.R'
'cvFolds.R' 'cvReshape.R' 'cvSelect.R' 'cvTool.R' 'cvTuning.R'
'densityplot.R' 'dotplot.R' 'plot.R' 'print.R' 'repCV.R'
'selectBest.R' 'subset.R' 'summary.R' 'utils.R' 'xyplot.R'
Packaged: 2012-02-13 12:16:53 UTC; andi
Repository: CRAN
Date/Publication: 2011-12-07 17:07:24
Date/Publication: 2012-02-13 12:46:49
83 changes: 42 additions & 41 deletions MD5
@@ -1,29 +1,29 @@
fc040270f59e000d737131e2b62d01db *DESCRIPTION
09f63cf33f60f752d33ada7aa00cef61 *NAMESPACE
19be3e29185ca04d81133a9659f53317 *NEWS
48b2c3810a8fa90471c4fb6b6b788287 *R/accessors.R
c68ea945f1d98b9627184222b4778e7e *R/aggregate.R
e7c1113e14898697bf4df600190488ca *R/bwplot.R
9242c02087bdbf1ef6de9063204d01db *R/cost.R
c8918b91b5a1ebcf3936d735331e6cd2 *R/cvExamples.R
363bb51711414f00f592c27762fa7dfd *R/cvFit.R
955411a4d1383a14960fd7e600e42f18 *R/cvFolds.R
5c16b115a94f3f32febef99071c3ed27 *R/cvReshape.R
968bb75ef4547e519a001b753aff8c7a *R/cvSelect.R
2006b0398493afc3b078eb2ffcb15d1c *R/cvTool.R
5502a11380c02e285d7f5909aa0ee639 *R/cvTuning.R
9c0195b959a2bb550f7d4ab02213cb7c *R/densityplot.R
140d36e327ab204880902dea1e0faead *R/dotplot.R
3f47fa5b135279093e3d104a13028481 *R/plot.R
7505ece24c6dbd1c721dbdd7c7fd57c6 *R/print.R
fe6b97561c271e8416ad2f8a9e669aeb *R/subset.R
6450e0cd3117c8c262fb51dff4acd43c *R/summary.R
e4d7f1157a58ac610fb9b64d119dd7df *R/utils.R
930e428a62aa12bd92b3284e0a01ba2d *R/xyplot.R
573d9de879faf2769d8d184ba369d017 *DESCRIPTION
3dfbab2b529557b78684f7246de5ed96 *NAMESPACE
13816a1032489b3be4aa53aa7a7f96b9 *NEWS
b397301b6de28042cd36de56b50ce145 *R/accessors.R
38b3a4b29c70ac2da562c21d00691c3c *R/aggregate.R
0c07168914e5627f96633e5dff9138e3 *R/bwplot.R
5ccfa919b733b028d5dabe8ec847a502 *R/cost.R
edecaa067584204843f2abfc0a124115 *R/cvFit.R
24398fd63f63f6438b805663588163f0 *R/cvFolds.R
91ff198fd41846d46fe00de82f7d686d *R/cvReshape.R
a86e39c97e83a9f282b87fffbb0546ad *R/cvSelect.R
74457ff168a8944717d900a486453546 *R/cvTool.R
5afeae9df0fd300f7704d0576606f236 *R/cvTuning.R
e4fdd61e76c8343e764aa239570bfa19 *R/densityplot.R
8d546cc39ae0b64871ccbaba493ab8c0 *R/dotplot.R
e649978d04434760d0e622c066e8d38a *R/plot.R
dcb0694d7a8837b2912ca5194fc6755e *R/print.R
07f4f56b8fde6df81e7920b4c6294c52 *R/repCV.R
14aea30357b3ca1031c8ab6c45731a03 *R/selectBest.R
f33204bb96e326b4327b0517b943918d *R/subset.R
a47692a042ebfe144e37b3d9fa5678be *R/summary.R
abe4bec9e985980935d52c0ed3965a79 *R/utils.R
c6ecc2da7c715f45ca435e7ef4918067 *R/xyplot.R
a7fb93ab8b8c87287ee6ae3532e4e084 *inst/doc/examples/example-accessors.R
96c17ca35116c5919d0a4b920e6faa6b *inst/doc/examples/example-aggregate.R
7e93e37e153121cfdac1595571d540b0 *inst/doc/examples/example-bwplot.R
91fa09a4b5fe431149023f32cd24bdfc *inst/doc/examples/example-cvExamples.R
6ed9c05c84a4f14609db195d00973eae *inst/doc/examples/example-cvFit.R
1ba5d997426d14332ef3e5b9d2ed0615 *inst/doc/examples/example-cvReshape.R
a03e81f822a631f313e955e132a33b66 *inst/doc/examples/example-cvSelect.R
Expand All @@ -32,24 +32,25 @@ a03e81f822a631f313e955e132a33b66 *inst/doc/examples/example-cvSelect.R
c3d7eedf0be5f2bb054397e7cd7fd742 *inst/doc/examples/example-densityplot.R
5bbb84a057d8895cf7b841b409d33cc6 *inst/doc/examples/example-dotplot.R
ef335dd66da19918ce14c845a881dce7 *inst/doc/examples/example-plot.R
16d5323935a11f27615ffdbe7887a191 *inst/doc/examples/example-repCV.R
331c3a0cf8fbedb337fb28d8d8447656 *inst/doc/examples/example-subset.R
09ff2ea3c53522657e74e01ffa7096a6 *inst/doc/examples/example-summary.R
0f3e66e0c10f34c66c4dc03aea3bc4ff *inst/doc/examples/example-xyplot.R
be6185c1028975e4e5c3c6fd18af5a5e *man/accessors.Rd
3524598663d42b47033adc6bacd5b0a6 *man/aggregate.cv.Rd
31c631cfd97fa2a05fc7b965e85742c9 *man/bwplot.cv.Rd
91ae69b7a16565e3bbe68ebce06bcefb *man/cost.Rd
b20d201b4d21c2fd98de29c5d7641dcc *man/cvExamples.Rd
076f5f90aeb28478fd60928c401f5313 *man/cvFit.Rd
3f8e6b06af39a887dccf57313e32bbab *man/cvFolds.Rd
ec22fe85e4c369d3bb39b1e47e4e5f08 *man/cvReshape.Rd
36b2534a6791129e4b53ee3f92c99d63 *man/cvSelect.Rd
37fd0a86766164550615de28c1a608c2 *man/cvTool.Rd
662b7d4f9b4d93d4cf52c94e8cb79293 *man/cvTools-package.Rd
8c50fa742d6bb9df66a319661de391a1 *man/cvTuning.Rd
5c318a3eb87222d45b88d44409a00a3f *man/densityplot.cv.Rd
aad5bcb236f1525ec16c49231d3efdfb *man/dotplot.cvSelect.Rd
38708544ed1937f12776aab5b4c70200 *man/plot.cv.Rd
43a068f6a1de41cd04d490d2b5d85aa0 *man/subset.cv.Rd
62bf8cc5e7c8ee3f81d21d7fe1cb0ebd *man/summary.cv.Rd
c7a712546a3b40294f26aae6bf3c2587 *man/xyplot.cvSelect.Rd
be915e96939dffdcd8b6e4b0b18bcca6 *man/accessors.Rd
04a6badc4198b636bb1748bf66abbe3c *man/aggregate.cv.Rd
ac323b29b7a1b77e70469fe7dff488c2 *man/bwplot.cv.Rd
2f1283c243c880f1be5a4c57c3f40e8e *man/cost.Rd
e7b5173b7ba6dd4c31c00aae1702d137 *man/cvFit.Rd
c3455f9c21a42fce405f2b739c8f99c8 *man/cvFolds.Rd
d522a615775388e3cd7326fb9bb70ab8 *man/cvReshape.Rd
606429e762e9b2820cc98366d2f8cbf8 *man/cvSelect.Rd
6988e084820a825fde952e4553351958 *man/cvTool.Rd
a037ae4b626e316ba8b3531a52dde51e *man/cvTools-package.Rd
90ca3ce5b98c2db1ce24a93039ec182b *man/cvTuning.Rd
1f1e5620a7f0540c04a0fdb00791b050 *man/densityplot.cv.Rd
8c31e99ae44736c8f8c9e0ffb3f2fcd8 *man/dotplot.cv.Rd
fa9ee4c80126a4530aeef5f01c5afc1b *man/plot.cv.Rd
02cea1c011bbcfb20cf8dd4d01f63eca *man/repCV.Rd
c1215e7f730038ccf0a241fdaf961ce7 *man/subset.cv.Rd
7543745fa1ff706e65d790c5ecd8b9b6 *man/summary.cv.Rd
80a2e79f72aa22aab6c1e3ecf4db8bbf *man/xyplot.cv.Rd
52 changes: 29 additions & 23 deletions NAMESPACE
@@ -1,26 +1,3 @@
export("cvNames<-")
export("fits<-")
export(cvFit)
export(cvFolds)
export(cvLm)
export(cvLmrob)
export(cvLts)
export(cvNames)
export(cvReshape)
export(cvSelect)
export(cvTool)
export(cvTuning)
export(fits)
export(mape)
export(mspe)
export(ncv)
export(nfits)
export(rmspe)
export(rtmspe)
export(tmspe)
import(lattice)
import(robustbase)
import(stats)
S3method("cvNames<-",cv)
S3method("cvNames<-",cvSelect)
S3method("fits<-",cv)
Expand All @@ -41,6 +18,7 @@ S3method(cvTuning,"function")
S3method(cvTuning,call)
S3method(densityplot,cv)
S3method(densityplot,cvSelect)
S3method(dotplot,cv)
S3method(dotplot,cvSelect)
S3method(fits,cv)
S3method(fits,cvSelect)
Expand All @@ -58,10 +36,38 @@ S3method(print,cvTuning)
S3method(print,summary.cv)
S3method(print,summary.cvSelect)
S3method(print,summary.cvTuning)
S3method(repCV,lm)
S3method(repCV,lmrob)
S3method(repCV,lts)
S3method(subset,cv)
S3method(subset,cvSelect)
S3method(summary,cv)
S3method(summary,cvSelect)
S3method(summary,cvTuning)
S3method(xyplot,cv)
S3method(xyplot,cvSelect)
S3method(xyplot,cvTuning)
export("cvNames<-")
export("fits<-")
export(cvFit)
export(cvFolds)
export(cvLm)
export(cvLmrob)
export(cvLts)
export(cvNames)
export(cvReshape)
export(cvSelect)
export(cvTool)
export(cvTuning)
export(fits)
export(mape)
export(mspe)
export(ncv)
export(nfits)
export(repCV)
export(rmspe)
export(rtmspe)
export(tmspe)
import(lattice)
import(robustbase)
import(stats)
22 changes: 22 additions & 0 deletions NEWS
@@ -1,3 +1,25 @@
Changes in cvTools version 0.2.0

+ New generic function repCV() for (repeated) K-fold cross-validation. The
example functions cvLm(), cvLmrob() and cvLts() are now aliases for the
respective methods.

+ Bugfix in cvFit(): default names are retained if cvTool() returns a
1x1 matrix.

+ Bugfix in plot.cvSelect(): default handling of argument 'method' no
longer throws error in case of only one replication.

+ Added functionality to incorporate standard errors.

+ cvSelect() and cvTuning() now allow to specify criterion for selecting
the best model via the argument 'selectBest'.

+ New xyplot() and dotplot() methods for class "cv".



Changes in cvTools version 0.1.1

+ Added different types of obtaining CV folds.

8 changes: 4 additions & 4 deletions R/accessors.R
@@ -1,6 +1,6 @@
# ----------------------
# Author: Andreas Alfons
# K.U.Leuven
# KU Leuven
# ----------------------

#' Access or set information on cross-validation results
Expand Down Expand Up @@ -63,7 +63,7 @@ cvNames.cvSelect <- function(x) names(x$cv)[-1]
#' @S3method cvNames<- cv
"cvNames<-.cv" <- function(x, value) {
object <- x
names(object$cv) <- value
names(object$cv) <- names(object$sd) <- value
if(!is.null(x$reps)) colnames(object$reps) <- value
eval.parent(substitute(x <- object))
}
Expand All @@ -73,7 +73,7 @@ cvNames.cvSelect <- function(x) names(x$cv)[-1]
object <- x
names(object$best) <- value
value <- c("Fit", value)
names(object$cv) <- value
names(object$cv) <- names(object$sd) <- value
if(!is.null(x$reps)) names(object$reps) <- value
eval.parent(substitute(x <- object))
}
Expand Down Expand Up @@ -104,7 +104,7 @@ fits.cvSelect <- function(x) x$cv$Fit
"fits<-.cvSelect" <- function(x, value) {
object <- x
if(is.factor(value)) value <- factor(as.character(value), levels=value)
object$cv$Fit <- value
object$cv$Fit <- object$sd$Fit <- value
if(!is.null(reps <- x$reps)) {
indices <- match(reps$Fit, x$cv$Fit, nomatch=0)
object$reps$Fit <- value[indices]
Expand Down
2 changes: 1 addition & 1 deletion R/aggregate.R
@@ -1,6 +1,6 @@
# ----------------------
# Author: Andreas Alfons
# K.U.Leuven
# KU Leuven
# ----------------------

#' Aggregate cross-validation results
Expand Down
4 changes: 2 additions & 2 deletions R/bwplot.R
@@ -1,6 +1,6 @@
# ----------------------
# Author: Andreas Alfons
# K.U.Leuven
# KU Leuven
# ----------------------

#' Box-and-whisker plots of cross-validation results
Expand Down Expand Up @@ -46,7 +46,7 @@

bwplot.cv <- function(x, data, select = NULL, ...) {
# initializations
if(x$R == 1) stop("density plot is only meaningful for repeated CV")
if(x$R == 1) stop("box plot is only meaningful for repeated CV")
# construct data frame in lattice format and call internal function
CV <- getLatticeData(x, select)
localBwplot(CV, ...)
Expand Down

0 comments on commit c2957d5

Please sign in to comment.