From 68d25b141f8663a964bef0830e2334cda4a9c1b2 Mon Sep 17 00:00:00 2001 From: Zygmunt Zawadzki Date: Tue, 25 Apr 2023 15:24:22 +0200 Subject: [PATCH] Fix LTO issue --- DESCRIPTION | 2 +- R/information_gain.R | 12 +++++++----- man/dot-information_gain.Rd | 6 +++--- src/init.c | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 91f8da5..668a25c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: FSelectorRcpp Type: Package Title: 'Rcpp' Implementation of 'FSelector' Entropy-Based Feature Selection Algorithms with a Sparse Matrix Support -Version: 0.3.10 +Version: 0.3.11 Authors@R: c( person("Zygmunt", "Zawadzki", role = c("aut", "cre"), email = "zygmunt@zstat.pl"), person("Marcin", "Kosinski", role = c("aut"), email = "m.p.kosinski@gmail.com"), diff --git a/R/information_gain.R b/R/information_gain.R index d3e5cbb..4d1ef86 100644 --- a/R/information_gain.R +++ b/R/information_gain.R @@ -100,8 +100,9 @@ information_gain <- function(formula, data, x, y, } if (!missing(formula) && !missing(data)) { - return(.information_gain(formula, data, type, equal, nbins, - threads, discIntegers = discIntegers)) + return(.information_gain(formula, data, type = type, + equal = equal, nbins = nbins, threads = threads, + discIntegers = discIntegers)) } } @@ -132,8 +133,8 @@ information_gain <- function(formula, data, x, y, .information_gain <- function(x, y, type = c("infogain", "gainratio", "symuncert"), equal = FALSE, - nbins = 5, discIntegers = TRUE, + nbins = 5, threads = 1) { UseMethod(".information_gain", x) } @@ -145,6 +146,7 @@ information_gain <- function(formula, data, x, y, "symuncert"), equal = FALSE, discIntegers = TRUE, + nbins = 5, threads = 1) { stop("Unsupported data type.") } @@ -202,8 +204,8 @@ information_gain <- function(formula, data, x, y, "gainratio", "symuncert"), equal = FALSE, - nbins = 5, discIntegers = TRUE, + nbins = 5, threads = 1) { if (!is.data.frame(y)) { stop("y must be a data.frame!") @@ -231,8 +233,8 @@ information_gain <- function(formula, data, x, y, "gainratio", "symuncert"), equal = FALSE, - nbins = 5, discIntegers = TRUE, + nbins = 5, threads = 1) { type <- match.arg(type) diff --git a/man/dot-information_gain.Rd b/man/dot-information_gain.Rd index 1c491b8..6b19a80 100644 --- a/man/dot-information_gain.Rd +++ b/man/dot-information_gain.Rd @@ -9,8 +9,8 @@ y, type = c("infogain", "gainratio", "symuncert"), equal = FALSE, - nbins = 5, discIntegers = TRUE, + nbins = 5, threads = 1 ) } @@ -24,12 +24,12 @@ \item{equal}{A logical. Whether to discretize dependent variable with the \code{equal frequency binning discretization} or not.} -\item{nbins}{Number of bins used for discretization. Only used if `equal = TRUE` and the response is numeric.} - \item{discIntegers}{logical value. If true (default), then integers are treated as numeric vectors and they are discretized. If false integers are treated as factors and they are left as is.} +\item{nbins}{Number of bins used for discretization. Only used if `equal = TRUE` and the response is numeric.} + \item{threads}{defunct. Number of threads for parallel backend - now turned off because of safety reasons.} } \description{ diff --git a/src/init.c b/src/init.c index 05ba8fc..dfd1fde 100644 --- a/src/init.c +++ b/src/init.c @@ -17,7 +17,7 @@ extern SEXP _FSelectorRcpp_fs_table_numeric2d(SEXP, SEXP); extern SEXP _FSelectorRcpp_fs_table1d(SEXP); extern SEXP _FSelectorRcpp_information_gain_cpp(SEXP, SEXP, SEXP, SEXP); extern SEXP _FSelectorRcpp_sparse_information_gain_cpp(SEXP, SEXP, SEXP); -extern void run_testthat_tests(void); +extern SEXP run_testthat_tests(SEXP use_xml_sxp); static const R_CallMethodDef CallEntries[] = { {"_FSelectorRcpp_cutOff_k", (DL_FUNC) &_FSelectorRcpp_cutOff_k, 3},