Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. \name{mccubc}
  2. \alias{mccubc}
  3. %- Also NEED an '\alias' for EACH other topic documented here.
  4. \title{
  5. %% ~~function to do ... ~~
  6. }
  7. \description{
  8. %% ~~ A concise (1-5 lines) description of what the function does. ~~
  9. }
  10. \usage{
  11. mccubc(X, Y, FUN, naive, ...)
  12. }
  13. %- maybe also 'usage' for other objects documented here.
  14. \arguments{
  15. \item{X}{
  16. %% ~~Describe \code{X} here~~
  17. }
  18. \item{Y}{
  19. %% ~~Describe \code{Y} here~~
  20. }
  21. \item{FUN}{
  22. %% ~~Describe \code{FUN} here~~
  23. }
  24. \item{naive}{
  25. %% ~~Describe \code{naive} here~~
  26. }
  27. \item{\dots}{
  28. %% ~~Describe \code{\dots} here~~
  29. }
  30. }
  31. \details{
  32. %% ~~ If necessary, more details than the description above ~~
  33. }
  34. \value{
  35. %% ~Describe the value returned
  36. %% If it is a LIST, use
  37. %% \item{comp1 }{Description of 'comp1'}
  38. %% \item{comp2 }{Description of 'comp2'}
  39. %% ...
  40. }
  41. \references{
  42. %% ~put references to the literature/web site here ~
  43. }
  44. \author{
  45. %% ~~who you are~~
  46. }
  47. \note{
  48. %% ~~further notes~~
  49. }
  50.  
  51. %% ~Make other sections like Warning with \section{Warning }{....} ~
  52.  
  53. \seealso{
  54. %% ~~objects to See Also as \code{\link{help}}, ~~~
  55. }
  56. \examples{
  57. ##---- Should be DIRECTLY executable !! ----
  58. ##-- ==> Define data, use random,
  59. ##-- or do help(data=index) for the standard data sets.
  60.  
  61. ## The function is currently defined as
  62. function (X, Y, FUN, naive, ...)
  63. {
  64. classes <- unique(Y)
  65. ecocMatrix <- makeMatrix(length(classes), length(classes),
  66. naive, removeColumns = TRUE)
  67. cat("Wymiary macierzy ECOC: ", dim(ecocMatrix), "\n")
  68. models <- apply(ecocMatrix, 2, function(x) {
  69. goodClasses <- classes[x == 1]
  70. .Target <- factor(ifelse(Y \%in\% goodClasses, 1, 0), levels = c(1,
  71. 0))
  72. dat <- data.frame(.Target, X)
  73. model <- FUN(.Target ~ ., data = dat, ...)
  74. return(model)
  75. })
  76. names(models) <- 1:sqrt(length(ecocMatrix))
  77. info <- list(X = X, Y = Y, classes = unique(Y))
  78. out <- list(models = models, info = info, ecoc = ecocMatrix)
  79. class(out) <- "mccubc"
  80. return(out)
  81. }
  82. }
  83. % Add one or more standard keywords, see file 'KEYWORDS' in the
  84. % R documentation directory.
  85. \keyword{ ~kwd1 }
  86. \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement