diff --git a/.ci/r_tests.sh b/.ci/r_tests.sh index cd547545..33902226 100755 --- a/.ci/r_tests.sh +++ b/.ci/r_tests.sh @@ -13,7 +13,10 @@ if [[ $OS_NAME == "macos-latest" ]]; then echo 'options(pkgType = "mac.binary")' > .Rprofile echo 'options(install.packages.check.source = "no")' >> .Rprofile else - tlmgr --verify-repo=none --self --all update + tlmgr --verify-repo=none update --self + tlmgr --verify-repo=none install ec + + echo "Sys.setenv(RETICULATE_PYTHON = '$CONDA_PREFIX/bin/python')" >> .Rprofile fi R_LIB_PATH=$HOME/R diff --git a/R-package/DESCRIPTION b/R-package/DESCRIPTION index 2da7012c..764a89a4 100644 --- a/R-package/DESCRIPTION +++ b/R-package/DESCRIPTION @@ -21,5 +21,5 @@ Suggests: rmarkdown Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.1 +RoxygenNote: 7.0.2 VignetteBuilder: knitr diff --git a/R-package/R/FastRGF_Classifier.R b/R-package/R/FastRGF_Classifier.R index 97f969ed..ea4d375d 100644 --- a/R-package/R/FastRGF_Classifier.R +++ b/R-package/R/FastRGF_Classifier.R @@ -51,7 +51,7 @@ #' min_child_weight = 5.0, data_l2 = 2.0, #' sparse_max_features = 80000, #' sparse_min_occurences = 5, -#' calc_prob="sigmoid", n_jobs = 1, +#' calc_prob = "sigmoid", n_jobs = 1, #' verbose = 0)}}{} #' #' \item{\code{--------------}}{} @@ -89,7 +89,7 @@ #' # min_child_weight = 5.0, data_l2 = 2.0, #' # sparse_max_features = 80000, #' # sparse_min_occurences = 5, -#' # calc_prob="sigmoid", n_jobs = 1, +#' # calc_prob = "sigmoid", n_jobs = 1, #' # verbose = 0) #' @examples #' @@ -111,7 +111,7 @@ #' preds = fast_RGF_class$predict_proba(x) #' } #' } -#' }, silent=TRUE) +#' }, silent = TRUE) FastRGF_Classifier <- R6::R6Class( "FastRGF_Classifier", diff --git a/R-package/R/FastRGF_Regressor.R b/R-package/R/FastRGF_Regressor.R index 13ad64a9..c72a0182 100644 --- a/R-package/R/FastRGF_Regressor.R +++ b/R-package/R/FastRGF_Regressor.R @@ -101,7 +101,7 @@ #' preds = fast_RGF_regr$predict(x) #' } #' } -#' }, silent=TRUE) +#' }, silent = TRUE) FastRGF_Regressor <- R6::R6Class( "FastRGF_Regressor", diff --git a/R-package/R/RGF_Classifier.R b/R-package/R/RGF_Classifier.R index 88b784df..abc28789 100644 --- a/R-package/R/RGF_Classifier.R +++ b/R-package/R/RGF_Classifier.R @@ -127,7 +127,7 @@ #' preds = RGF_class$predict_proba(x) #' } #' } -#' }, silent=TRUE) +#' }, silent = TRUE) RGF_Classifier <- R6::R6Class( "RGF_Classifier", diff --git a/R-package/R/RGF_Regressor.R b/R-package/R/RGF_Regressor.R index c30cca8d..edcaa62e 100644 --- a/R-package/R/RGF_Regressor.R +++ b/R-package/R/RGF_Regressor.R @@ -117,7 +117,7 @@ #' preds = RGF_regr$predict(x) #' } #' } -#' }, silent=TRUE) +#' }, silent = TRUE) RGF_Regressor <- R6::R6Class( "RGF_Regressor", diff --git a/R-package/R/TO_scipy_sparse.R b/R-package/R/TO_scipy_sparse.R index d90c19b0..ce055e92 100644 --- a/R-package/R/TO_scipy_sparse.R +++ b/R-package/R/TO_scipy_sparse.R @@ -55,7 +55,7 @@ #' } #' } #' } -#' }, silent=TRUE) +#' }, silent = TRUE) TO_scipy_sparse = function(R_sparse_matrix) { diff --git a/R-package/R/mat_2scipy_sparse.R b/R-package/R/mat_2scipy_sparse.R index 15b5e270..afa56437 100644 --- a/R-package/R/mat_2scipy_sparse.R +++ b/R-package/R/mat_2scipy_sparse.R @@ -26,7 +26,7 @@ #' print(res$shape) #' } #' } -#' }, silent=TRUE) +#' }, silent = TRUE) mat_2scipy_sparse = function(x, format = 'sparse_row_matrix') { diff --git a/R-package/R/package.R b/R-package/R/package.R index 60624c25..05ed72f8 100644 --- a/R-package/R/package.R +++ b/R-package/R/package.R @@ -29,15 +29,15 @@ RGF_mod <- NULL; RGF_utils <- NULL; SCP <- NULL; try({ # I added the try() functions in version 1.0.7 because I received a similar warning as mentioned in: [ https://github.com/rstudio/reticulate/issues/730#issuecomment-594365528 ] and [ https://github.com/rstudio/reticulate/issues/814 ] RGF_mod <<- reticulate::import("rgf.sklearn", delay_load = TRUE) - }, silent=TRUE) + }, silent = TRUE) try({ RGF_utils <<- reticulate::import("rgf.utils", delay_load = TRUE) - }, silent=TRUE) + }, silent = TRUE) try({ SCP <<- reticulate::import("scipy", delay_load = TRUE, convert = FALSE) - }, silent=TRUE) + }, silent = TRUE) # #................................................................................. keep this as a reference, however it gives a warning on CRAN because it tries to initialize python # try({ @@ -59,6 +59,6 @@ RGF_mod <- NULL; RGF_utils <- NULL; SCP <- NULL; # # else { # # packageStartupMessage("The 'scipy' package is not available!") # # } - # }, silent=TRUE) + # }, silent = TRUE) # #................................................................................. } diff --git a/R-package/man/FastRGF_Classifier.Rd b/R-package/man/FastRGF_Classifier.Rd index 1ec2c269..177c6194 100644 --- a/R-package/man/FastRGF_Classifier.Rd +++ b/R-package/man/FastRGF_Classifier.Rd @@ -13,7 +13,7 @@ # min_child_weight = 5.0, data_l2 = 2.0, # sparse_max_features = 80000, # sparse_min_occurences = 5, -# calc_prob="sigmoid", n_jobs = 1, +# calc_prob = "sigmoid", n_jobs = 1, # verbose = 0) } \description{ @@ -46,7 +46,7 @@ the \emph{score} function returns the mean accuracy on the given test data and l min_child_weight = 5.0, data_l2 = 2.0, sparse_max_features = 80000, sparse_min_occurences = 5, - calc_prob="sigmoid", n_jobs = 1, + calc_prob = "sigmoid", n_jobs = 1, verbose = 0)}}{} \item{\code{--------------}}{} @@ -97,7 +97,7 @@ try({ preds = fast_RGF_class$predict_proba(x) } } -}, silent=TRUE) +}, silent = TRUE) } \references{ \emph{https://github.com/RGF-team/rgf/tree/master/python-package}, \emph{Tong Zhang, FastRGF: Multi-core Implementation of Regularized Greedy Forest (https://github.com/RGF-team/rgf/tree/master/FastRGF)} @@ -129,7 +129,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} \subsection{Method \code{new()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{FastRGF_Classifier$new( @@ -198,7 +197,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ diff --git a/R-package/man/FastRGF_Regressor.Rd b/R-package/man/FastRGF_Regressor.Rd index f889e18a..23a35a2c 100644 --- a/R-package/man/FastRGF_Regressor.Rd +++ b/R-package/man/FastRGF_Regressor.Rd @@ -89,7 +89,7 @@ try({ preds = fast_RGF_regr$predict(x) } } -}, silent=TRUE) +}, silent = TRUE) } \references{ \emph{https://github.com/RGF-team/rgf/tree/master/python-package}, \emph{Tong Zhang, FastRGF: Multi-core Implementation of Regularized Greedy Forest (https://github.com/RGF-team/rgf/tree/master/FastRGF)} @@ -121,7 +121,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} \subsection{Method \code{new()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{FastRGF_Regressor$new( @@ -184,7 +183,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ diff --git a/R-package/man/Internal_class.Rd b/R-package/man/Internal_class.Rd index 0b26a3da..c469f219 100644 --- a/R-package/man/Internal_class.Rd +++ b/R-package/man/Internal_class.Rd @@ -26,7 +26,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-fit}{}}} \subsection{Method \code{fit()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$fit(x, y, sample_weight = NULL)}\if{html}{\out{
}} @@ -35,7 +34,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-predict}{}}} \subsection{Method \code{predict()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$predict(x)}\if{html}{\out{
}} @@ -44,7 +42,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-predict_proba}{}}} \subsection{Method \code{predict_proba()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$predict_proba(x)}\if{html}{\out{
}} @@ -53,7 +50,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-cleanup}{}}} \subsection{Method \code{cleanup()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$cleanup()}\if{html}{\out{
}} @@ -62,7 +58,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-get_params}{}}} \subsection{Method \code{get_params()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$get_params(deep = TRUE)}\if{html}{\out{
}} @@ -71,7 +66,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-score}{}}} \subsection{Method \code{score()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$score(x, y, sample_weight = NULL)}\if{html}{\out{
}} @@ -80,7 +74,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-feature_importances}{}}} \subsection{Method \code{feature_importances()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$feature_importances()}\if{html}{\out{
}} @@ -89,7 +82,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-dump_model}{}}} \subsection{Method \code{dump_model()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$dump_model()}\if{html}{\out{
}} @@ -98,7 +90,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-save_model}{}}} \subsection{Method \code{save_model()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Internal_class$save_model(filename)}\if{html}{\out{
}} @@ -107,7 +98,6 @@ Internal R6 class for all secondary functions used in RGF and FastRGF } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ diff --git a/R-package/man/RGF_Classifier.Rd b/R-package/man/RGF_Classifier.Rd index cb20c4d3..17ee2ac9 100644 --- a/R-package/man/RGF_Classifier.Rd +++ b/R-package/man/RGF_Classifier.Rd @@ -111,7 +111,7 @@ try({ preds = RGF_class$predict_proba(x) } } -}, silent=TRUE) +}, silent = TRUE) } \references{ \emph{https://github.com/RGF-team/rgf/tree/master/python-package}, \emph{Rie Johnson and Tong Zhang, Learning Nonlinear Functions Using Regularized Greedy Forest} @@ -143,7 +143,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} \subsection{Method \code{new()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{RGF_Classifier$new( @@ -212,7 +211,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ diff --git a/R-package/man/RGF_Regressor.Rd b/R-package/man/RGF_Regressor.Rd index 8a507a35..b4eb7e0f 100644 --- a/R-package/man/RGF_Regressor.Rd +++ b/R-package/man/RGF_Regressor.Rd @@ -103,7 +103,7 @@ try({ preds = RGF_regr$predict(x) } } -}, silent=TRUE) +}, silent = TRUE) } \references{ \emph{https://github.com/RGF-team/rgf/tree/master/python-package}, \emph{Rie Johnson and Tong Zhang, Learning Nonlinear Functions Using Regularized Greedy Forest} @@ -135,7 +135,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} \subsection{Method \code{new()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{RGF_Regressor$new( @@ -198,7 +197,6 @@ try({ } \if{html}{\out{
}} \if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ diff --git a/R-package/man/TO_scipy_sparse.Rd b/R-package/man/TO_scipy_sparse.Rd index 74249309..ff68b5d5 100644 --- a/R-package/man/TO_scipy_sparse.Rd +++ b/R-package/man/TO_scipy_sparse.Rd @@ -61,7 +61,7 @@ try({ } } } -}, silent=TRUE) +}, silent = TRUE) } \references{ https://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/dgCMatrix-class.html, https://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/dgRMatrix-class.html, https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csc_matrix.html#scipy.sparse.csc_matrix diff --git a/R-package/man/mat_2scipy_sparse.Rd b/R-package/man/mat_2scipy_sparse.Rd index d1e76f70..a5f9b290 100644 --- a/R-package/man/mat_2scipy_sparse.Rd +++ b/R-package/man/mat_2scipy_sparse.Rd @@ -36,7 +36,7 @@ try({ print(res$shape) } } -}, silent=TRUE) +}, silent = TRUE) } \references{ https://docs.scipy.org/doc/scipy/reference/sparse.html diff --git a/R-package/tests/testthat/setup.R b/R-package/tests/testthat/setup.R index 25d9c7e7..04794efc 100644 --- a/R-package/tests/testthat/setup.R +++ b/R-package/tests/testthat/setup.R @@ -26,14 +26,14 @@ y_reg = runif(100) #--------------------------------- set.seed(4) -y_BINclass = sample(1:2, 100, replace = T) +y_BINclass = sample(1:2, 100, replace = TRUE) # response "multiclass" classification #------------------------------------- set.seed(5) -y_MULTIclass = sample(1:5, 100, replace = T) +y_MULTIclass = sample(1:5, 100, replace = TRUE) # weights for the fit function