R/RcppExports.R

Defines functions weight_matrix_cpp observation_impute_cpp_simple

Documented in observation_impute_cpp_simple weight_matrix_cpp

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @exportPattern "^[[:alpha:]]+"
#' @importFrom Rcpp evalCpp
#' @useDynLib PPtreeregViz
NULL

#' Get imputed data
#'
#' @param xbar mean of each leaf.
#'
#' @param index_simple Positive integer.
#'
#' @param xtest Numeric matrix. Represents a single test observation.
#'
#' @param S Integer matrix of dimension \code{n_combinations x m}, where \code{n_combinations} equals
#' the total number of sampled/non-sampled feature combinations and \code{m} equals
#' the total number of unique features. Note that \code{m = ncol(xtrain)}. See details
#' for more information.
#'
#' @export
#' @keywords internal
#'
#' @return Numeric matrix
#'
#' @author Nikolai Sellereite
observation_impute_cpp_simple <- function(xbar, index_simple, xtest, S) {
    .Call(`_PPtreeregViz_observation_impute_cpp_simple`, xbar, index_simple, xtest, S)
}

#' Calculate weight matrix
#'
#' @param subsets List. Each of the elements equals an integer
#' vector representing a valid combination of features/feature groups.
#' @param m Integer. Number of features/feature groups
#' @param n Integer. Number of combinations
#' @param w Numeric vector of length \code{n}, i.e. \code{w[i]} equals
#' the Shapley weight of feature/feature group combination \code{i}, represented by
#' \code{subsets[[i]]}.
#'
#' @export
#' @keywords internal
#'
#' @return Matrix of dimension n x m + 1
#' @author Nikolai Sellereite
weight_matrix_cpp <- function(subsets, m, n, w) {
    .Call(`_PPtreeregViz_weight_matrix_cpp`, subsets, m, n, w)
}

Try the PPtreeregViz package in your browser

Any scripts or data that you put into this service are public.

PPtreeregViz documentation built on Dec. 24, 2022, 1:50 a.m.