R/RcppExports.R

Defines functions build_module

Documented in build_module

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

#' Fit a regression tree.
#' 
#' Fit a regression tree based on Gaussian Likelihood score. Provided in case the best split
#' is not applicable for R dnorm() function.
#' @param X A n by p matrix as input.
#' @param Y A n by q matrix as response.
#' @param max_depth Maximum depth of the tree.
#' @param cor_cutoff Cutoff for within group Pearson correlation coefficient, if all data belong to a node 
#' have average correlation greater or equal to this, the node would not split anymore.
#' @param min_divide_size Minimum number of data belong to a node allowed for further split of the node.
#' 
#' @return A matrix for sample informatrion for each partition level. First column is feature index used 
#' by the node and second is the value used to split, the rest of the columns are the split of sample: 0 means 
#' less or equal, 1 means greater and -1 means the sample does not belong to this node.
#' @examples
#' build_module(X = matrix(rnorm(5*10),5,10), Y = matrix(rnorm(5*10),5,10),
#'                          max_depth=3,cor_cutoff=0.9,min_divide_size=3)
#' @export
build_module <- function(X, Y, max_depth, cor_cutoff, min_divide_size) {
    .Call('_GNET2_build_module', PACKAGE = 'GNET2', X, Y, max_depth, cor_cutoff, min_divide_size)
}
chrischen1/GNET2 documentation built on June 29, 2022, 8:53 a.m.