From 2c84daeca7a7098b9ad3594426be3eac4707a675 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 14 Aug 2023 09:18:02 -0500 Subject: [PATCH] [R] [doc] remove documentation index entries for internal functions (#9477) --- R-package/R/xgb.ggplot.R | 2 ++ R-package/man/normalize.Rd | 18 --------------- R-package/man/prepare.ggplot.shap.data.Rd | 27 ----------------------- 3 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 R-package/man/normalize.Rd delete mode 100644 R-package/man/prepare.ggplot.shap.data.Rd diff --git a/R-package/R/xgb.ggplot.R b/R-package/R/xgb.ggplot.R index f96a8a37f..69d26e2c4 100644 --- a/R-package/R/xgb.ggplot.R +++ b/R-package/R/xgb.ggplot.R @@ -142,6 +142,7 @@ xgb.ggplot.shap.summary <- function(data, shap_contrib = NULL, features = NULL, #' #' @return A data.table containing the observation ID, the feature name, the #' feature value (normalized if specified), and the SHAP contribution value. +#' @noRd prepare.ggplot.shap.data <- function(data_list, normalize = FALSE) { data <- data_list[["data"]] shap_contrib <- data_list[["shap_contrib"]] @@ -170,6 +171,7 @@ prepare.ggplot.shap.data <- function(data_list, normalize = FALSE) { #' @param x Numeric vector #' #' @return Numeric vector with mean 0 and sd 1. +#' @noRd normalize <- function(x) { loc <- mean(x, na.rm = TRUE) scale <- stats::sd(x, na.rm = TRUE) diff --git a/R-package/man/normalize.Rd b/R-package/man/normalize.Rd deleted file mode 100644 index 6a05e8342..000000000 --- a/R-package/man/normalize.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/xgb.ggplot.R -\name{normalize} -\alias{normalize} -\title{Scale feature value to have mean 0, standard deviation 1} -\usage{ -normalize(x) -} -\arguments{ -\item{x}{Numeric vector} -} -\value{ -Numeric vector with mean 0 and sd 1. -} -\description{ -This is used to compare multiple features on the same plot. -Internal utility function -} diff --git a/R-package/man/prepare.ggplot.shap.data.Rd b/R-package/man/prepare.ggplot.shap.data.Rd deleted file mode 100644 index 57f71a3ff..000000000 --- a/R-package/man/prepare.ggplot.shap.data.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/xgb.ggplot.R -\name{prepare.ggplot.shap.data} -\alias{prepare.ggplot.shap.data} -\title{Combine and melt feature values and SHAP contributions for sample -observations.} -\usage{ -prepare.ggplot.shap.data(data_list, normalize = FALSE) -} -\arguments{ -\item{data_list}{List containing 'data' and 'shap_contrib' returned by -\code{xgb.shap.data()}.} - -\item{normalize}{Whether to standardize feature values to have mean 0 and -standard deviation 1 (useful for comparing multiple features on the same -plot). Default \code{FALSE}.} -} -\value{ -A data.table containing the observation ID, the feature name, the - feature value (normalized if specified), and the SHAP contribution value. -} -\description{ -Conforms to data format required for ggplot functions. -} -\details{ -Internal utility function. -}