Skip to content

Commit

Permalink
docs & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
egenn committed Oct 16, 2024
1 parent 85a52ed commit a12dbf6
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rtemis
Version: 0.98.0
Title: Machine Learning and Visualization
Date: 2024-09-30
Date: 2024-10-08
Authors@R: person(given = "E.D.", family = "Gennatas", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0001-9280-3609"))
Description: Advanced Machine Learning and Visualization. Unsupervised Learning (Clustering, Decomposition), Supervised Learning (Classification, Regression), Cross-Decomposition, Bagging, Boosting, Meta-models. Static and interactive graphics.
License: GPL (>= 3)
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export(as.data.tree.rpart)
export(auc)
export(auc_pairs)
export(bacc)
export(bag)
export(betas.lihad)
export(bias_variance)
export(binmat2vec)
Expand Down Expand Up @@ -306,6 +305,7 @@ export(prune.addtree)
export(psd)
export(qstat)
export(read)
export(read_config)
export(recycle)
export(relu)
export(resample)
Expand Down
6 changes: 2 additions & 4 deletions R/msg.R
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ msg2 <- function(...,
}
cat(paste(txt, collapse = sep))
if (!is.null(caller) && !is.na(caller)) {
cat(gray(" [", caller, "]\n", sep = ""), sep = "")
cat(gray(" :", caller, "\n", sep = ""), sep = "")
} else if (newline) {
cat("\n")
}
Expand Down Expand Up @@ -287,14 +287,12 @@ msg20 <- function(...,
}

txt <- Filter(Negate(is.null), list(...))
# .dt <- if (date) paste0(as.character(Sys.time())) else NULL
.dt <- format(Sys.time(), "%m-%d-%y %H:%M:%S")
if (newline.pre) cat("\n")
cat(gray(paste0(.dt, gray(" "))))
cat(paste(txt, collapse = sep))
# cat(gray(" [", caller, "]\n", sep = ""), sep = "")
if (!is.null(caller) && !is.na(caller)) {
cat(gray(" [", caller, "]\n", sep = ""), sep = "")
cat(gray(" :", caller, "\n", sep = ""), sep = "")
} else if (newline) {
cat("\n")
}
Expand Down
2 changes: 1 addition & 1 deletion R/resample.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#' res <- resample(y, 25, "strat.sub")
#' # 100 stratified bootstraps
#' res <- resample(y, 100, "strat.boot")
#'

resample <- function(y,
n.resamples = 10,
resampler = c("strat.sub", "strat.boot", "kfold",
Expand Down
2 changes: 1 addition & 1 deletion R/s_LightGBM.R
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ s_LightGBM <- function(x, y = NULL,
rt
} # rtemis::s_LightGBM

#' Random Forest with LightGBM
#' Random Forest using LightGBM
#'
#' @inheritParams s_LightGBM
#' @param nrounds Integer: Number of trees to grow
Expand Down
5 changes: 2 additions & 3 deletions R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ NULL

#' Set [resample] settings
#'
#'
#' @inheritParams resample
#' @export

setup.resample <- function(
resampler = "strat.sub",
resampler = c("strat.sub", "strat.boot", "kfold", "bootstrap", "loocv"),
n.resamples = 10,
stratify.var = NULL,
train.p = .8,
Expand All @@ -28,7 +27,7 @@ setup.resample <- function(
id.strat = NULL,
seed = NULL) {
list(
resampler = resampler,
resampler = match.arg(resampler),
n.resamples = n.resamples,
stratify.var = stratify.var,
train.p = train.p,
Expand Down
5 changes: 3 additions & 2 deletions R/type_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ inherits_check <- function(x, cl) {


#' Function that returns object if it is of a certain class
#'
#'
#' @param object Object to check and return
#' @param class Character vector: class(es) to check against
#' @param allow_null Logical: if TRUE, allows NULL objects
#'
#'
#' @return Object
#' @author EDG
#' @keywords internal
Expand All @@ -102,6 +102,7 @@ inherits_check <- function(x, cl) {
#' strict("papaya", "character") # "papaya"
#' strict(c(1, 2.5, 3.2), "integer") # Error
#' strict(iris, "list") # Error
#' }
strict <- function(object, class, allow_null = TRUE) {
if (allow_null && is.null(object)) {
return(NULL)
Expand Down
2 changes: 2 additions & 0 deletions man/massGAM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/resample.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/strict.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a12dbf6

Please sign in to comment.