R/common.R

Defines functions SplitDataset

SplitDataset <- function(sub_test_X, sub_test_Y, split_var, split_point) {
  result <- list()
  if (class(sub_test_X[, split_var]) == "numeric") {
    left_index <- sub_test_X[, split_var] <= split_point
    right_index <- sub_test_X[, split_var] > split_point

    result$left_x <- sub_test_X[left_index, , drop=FALSE]
    result$left_y <- sub_test_Y[left_index, , drop=FALSE]

    result$right_x <- sub_test_X[right_index, , drop=FALSE]
    result$right_y <- sub_test_Y[right_index, , drop=FALSE]
  } else {
    # TODO split factor features
    # result$left <- dataset
    # result$right <- dataset
  }
  result
}

Try the MulvariateRandomForestVarImp package in your browser

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

MulvariateRandomForestVarImp documentation built on Dec. 15, 2021, 5:07 p.m.