DF_pred: Decision Forest algorithm: Model prediction

Description Usage Arguments Value Examples

Description

Decision Forest algorithm: Model prediction with constructed DF models. DT_models is a list of Decision Tree models (rpart.objects) generated by DF_train() DT_train_CV() is only designed for Cross-validation and won't generate models

Usage

1
DF_pred(DT_models, X, Y = NULL)

Arguments

DT_models

Constructed DF models

X

Test Dataset

Y

Test data endpoint

Value

.$accuracy: Overall test accuracy

.$predictions: Detailed test prediction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  data(demo_simple)
  X = Data_simple$X
  Y = Data_simple$Y
  names(Y)=rownames(X)

  random_seq=sample(nrow(X))
  split_rate=3
  split_sample = suppressWarnings(split(random_seq,1:split_rate))
  Train_X = X[-random_seq[split_sample[[1]]],]
  Train_Y = Y[-random_seq[split_sample[[1]]]]
  Test_X = X[random_seq[split_sample[[1]]],]
  Test_Y = Y[random_seq[split_sample[[1]]]]

  used_model = DF_train(Train_X, Train_Y,stop_step=4, Method = "MCC")
  Pred_result = DF_pred(used_model,Test_X,Test_Y)
  DF_ConfPlot(Pred_result, Test_Y, bin = 40)

seldas/Dforest documentation built on May 30, 2019, 8:08 p.m.