Skip to content

Commit a12dbf6

Browse files
committed
docs & cleanup
1 parent 85a52ed commit a12dbf6

10 files changed

+20
-14
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rtemis
22
Version: 0.98.0
33
Title: Machine Learning and Visualization
4-
Date: 2024-09-30
4+
Date: 2024-10-08
55
Authors@R: person(given = "E.D.", family = "Gennatas", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0001-9280-3609"))
66
Description: Advanced Machine Learning and Visualization. Unsupervised Learning (Clustering, Decomposition), Supervised Learning (Classification, Regression), Cross-Decomposition, Bagging, Boosting, Meta-models. Static and interactive graphics.
77
License: GPL (>= 3)

NAMESPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export(as.data.tree.rpart)
7777
export(auc)
7878
export(auc_pairs)
7979
export(bacc)
80-
export(bag)
8180
export(betas.lihad)
8281
export(bias_variance)
8382
export(binmat2vec)
@@ -306,6 +305,7 @@ export(prune.addtree)
306305
export(psd)
307306
export(qstat)
308307
export(read)
308+
export(read_config)
309309
export(recycle)
310310
export(relu)
311311
export(resample)

R/msg.R

+2-4
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ msg2 <- function(...,
248248
}
249249
cat(paste(txt, collapse = sep))
250250
if (!is.null(caller) && !is.na(caller)) {
251-
cat(gray(" [", caller, "]\n", sep = ""), sep = "")
251+
cat(gray(" :", caller, "\n", sep = ""), sep = "")
252252
} else if (newline) {
253253
cat("\n")
254254
}
@@ -287,14 +287,12 @@ msg20 <- function(...,
287287
}
288288

289289
txt <- Filter(Negate(is.null), list(...))
290-
# .dt <- if (date) paste0(as.character(Sys.time())) else NULL
291290
.dt <- format(Sys.time(), "%m-%d-%y %H:%M:%S")
292291
if (newline.pre) cat("\n")
293292
cat(gray(paste0(.dt, gray(" "))))
294293
cat(paste(txt, collapse = sep))
295-
# cat(gray(" [", caller, "]\n", sep = ""), sep = "")
296294
if (!is.null(caller) && !is.na(caller)) {
297-
cat(gray(" [", caller, "]\n", sep = ""), sep = "")
295+
cat(gray(" :", caller, "\n", sep = ""), sep = "")
298296
} else if (newline) {
299297
cat("\n")
300298
}

R/resample.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#' res <- resample(y, 25, "strat.sub")
5353
#' # 100 stratified bootstraps
5454
#' res <- resample(y, 100, "strat.boot")
55-
#'
55+
5656
resample <- function(y,
5757
n.resamples = 10,
5858
resampler = c("strat.sub", "strat.boot", "kfold",

R/s_LightGBM.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ s_LightGBM <- function(x, y = NULL,
443443
rt
444444
} # rtemis::s_LightGBM
445445

446-
#' Random Forest with LightGBM
446+
#' Random Forest using LightGBM
447447
#'
448448
#' @inheritParams s_LightGBM
449449
#' @param nrounds Integer: Number of trees to grow

R/setup.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ NULL
1414

1515
#' Set [resample] settings
1616
#'
17-
#'
1817
#' @inheritParams resample
1918
#' @export
2019

2120
setup.resample <- function(
22-
resampler = "strat.sub",
21+
resampler = c("strat.sub", "strat.boot", "kfold", "bootstrap", "loocv"),
2322
n.resamples = 10,
2423
stratify.var = NULL,
2524
train.p = .8,
@@ -28,7 +27,7 @@ setup.resample <- function(
2827
id.strat = NULL,
2928
seed = NULL) {
3029
list(
31-
resampler = resampler,
30+
resampler = match.arg(resampler),
3231
n.resamples = n.resamples,
3332
stratify.var = stratify.var,
3433
train.p = train.p,

R/type_check.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ inherits_check <- function(x, cl) {
8989

9090

9191
#' Function that returns object if it is of a certain class
92-
#'
92+
#'
9393
#' @param object Object to check and return
9494
#' @param class Character vector: class(es) to check against
9595
#' @param allow_null Logical: if TRUE, allows NULL objects
96-
#'
96+
#'
9797
#' @return Object
9898
#' @author EDG
9999
#' @keywords internal
@@ -102,6 +102,7 @@ inherits_check <- function(x, cl) {
102102
#' strict("papaya", "character") # "papaya"
103103
#' strict(c(1, 2.5, 3.2), "integer") # Error
104104
#' strict(iris, "list") # Error
105+
#' }
105106
strict <- function(object, class, allow_null = TRUE) {
106107
if (allow_null && is.null(object)) {
107108
return(NULL)

man/massGAM.Rd

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/resample.Rd

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/strict.Rd

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)