Skip to contents

This function is deprecated. Please use predict() with type = "terminalNodes" instead. This function calls predict() now.

Usage

getTerminalNodeIDs(rf, dat)

Arguments

rf

ranger object.

dat

New dataset. Terminal node IDs for this dataset are obtained.

Value

Matrix with terminal nodeIDs for all observations in dataset and trees.

Examples

rf <- ranger(Species ~ ., data = iris, num.trees = 5, write.forest = TRUE)
getTerminalNodeIDs(rf, iris)
#> Warning: Function getTerminalNodeIDs() deprecated, calling predict().
#>        [,1] [,2] [,3] [,4] [,5]
#>   [1,]    1    1    1    1    1
#>   [2,]    1    1    1    1    1
#>   [3,]    1    1    1    1    1
#>   [4,]    1    1    1    1    1
#>   [5,]    1    1    1    1    1
#>   [6,]    1    1    1    1    1
#>   [7,]    1    1    1    1    1
#>   [8,]    1    1    1    1    1
#>   [9,]    1    1    1    1    1
#>  [10,]    1    1    1    1    1
#>  [11,]    1    1    1    1    1
#>  [12,]    1    1    1    1    1
#>  [13,]    1    1    1    1    1
#>  [14,]    1    1    1    1    1
#>  [15,]    1    1    1    1    1
#>  [16,]    1    1    1    1    1
#>  [17,]    1    1    1    1    1
#>  [18,]    1    1    1    1    1
#>  [19,]    1    1    1    1    1
#>  [20,]    1    1    1    1    1
#>  [21,]    1    1    1    1    1
#>  [22,]    1    1    1    1    1
#>  [23,]    1    1    1    1    1
#>  [24,]    1    1    1    1    1
#>  [25,]    1    1    1    1    1
#>  [26,]    1    1    1    1    1
#>  [27,]    1    1    1    1    1
#>  [28,]    1    1    1    1    1
#>  [29,]    1    1    1    1    1
#>  [30,]    1    1    1    1    1
#>  [31,]    1    1    1    1    1
#>  [32,]    1    1    1    1    1
#>  [33,]    1    1    1    1    1
#>  [34,]    1    1    1    1    1
#>  [35,]    1    1    1    1    1
#>  [36,]    1    1    1    1    1
#>  [37,]    1    1    1    1    1
#>  [38,]    1    1    1    1    1
#>  [39,]    1    1    1    1    1
#>  [40,]    1    1    1    1    1
#>  [41,]    1    1    1    1    1
#>  [42,]    1    1    1    1    1
#>  [43,]    1    1    1    1    1
#>  [44,]    1    1    1    1    1
#>  [45,]    1    1    1    1    1
#>  [46,]    1    1    1    1    1
#>  [47,]    1    1    1    1    1
#>  [48,]    1    1    1    1    1
#>  [49,]    1    1    1    1    1
#>  [50,]    1    1    1    1    1
#>  [51,]    5    5   17   10   12
#>  [52,]    5    5   17   10   12
#>  [53,]   11    5   20   20   12
#>  [54,]    5    5   17   10    9
#>  [55,]    5    5   17   10   12
#>  [56,]    5    5   17   10    9
#>  [57,]    5    5   17   10   12
#>  [58,]    5    5   15   15    9
#>  [59,]    5    5   17   10   12
#>  [60,]    5    5   17   10    9
#>  [61,]    5    5   17   10    9
#>  [62,]    5    5   17   10   14
#>  [63,]    5    5   17   10   15
#>  [64,]    5    5   17   10   14
#>  [65,]    5    5   17   10    9
#>  [66,]    5    5   17   10   12
#>  [67,]    5    5   17   10    9
#>  [68,]    5    5   17   10   14
#>  [69,]    5    5   17   10   12
#>  [70,]    5    5   17   10    9
#>  [71,]   10   12   23   11    8
#>  [72,]    5    5   17   10   14
#>  [73,]   11    5   20   20   12
#>  [74,]    5    5   17   10   14
#>  [75,]    5    5   17   10   12
#>  [76,]    5    5   17   10   12
#>  [77,]   11    5   17   18   12
#>  [78,]   14    8   20   20   12
#>  [79,]    5    5   17   10   14
#>  [80,]    5    5   17   10    9
#>  [81,]    5    5   17   10    9
#>  [82,]    5    5   17   10    9
#>  [83,]    5    5   17   10   14
#>  [84,]   14    5   21   20   14
#>  [85,]    5    5   17   10    9
#>  [86,]    5    5   17   10   14
#>  [87,]    5    5   17   10   12
#>  [88,]    5    5   17   10   12
#>  [89,]    5    5   17   10    9
#>  [90,]    5    5   17   10    9
#>  [91,]    5    5   17   10    9
#>  [92,]    5    5   17   10   14
#>  [93,]    5    5   17   10   15
#>  [94,]    5    5   17   10    9
#>  [95,]    5    5   17   10    9
#>  [96,]    5    5   17   10    9
#>  [97,]    5    5   17   10    9
#>  [98,]    5    5   17   10   12
#>  [99,]    5    5   17   10    9
#> [100,]    5    5   17   10    9
#> [101,]    8    8    8    8    8
#> [102,]   10    8   22    8    8
#> [103,]    8    8    8    8    8
#> [104,]    8    8    8    8    8
#> [105,]    8    8    8    8    8
#> [106,]    8    8    8    8    8
#> [107,]    6   11   16   16   10
#> [108,]    8    8    8    8    8
#> [109,]    8    8    8    8    8
#> [110,]    8    8    8    8    8
#> [111,]   10    8    8    8    8
#> [112,]    8    8    8    8    8
#> [113,]    8    8    8    8    8
#> [114,]   10    8   12    8    6
#> [115,]   10    8   22    8    8
#> [116,]    8    8    8    8    8
#> [117,]    8    8    8    8    8
#> [118,]    8    8    8    8    8
#> [119,]    8    8    8    8    8
#> [120,]   13    5   19   19   16
#> [121,]    8    8    8    8    8
#> [122,]   10    8   12    8    6
#> [123,]    8    8    8    8    8
#> [124,]   10    8   12    8    8
#> [125,]    8    8    8    8    8
#> [126,]    8    8    8    8    8
#> [127,]   10   10   24   17    8
#> [128,]   10    8   12    8    8
#> [129,]    8    8    8    8    8
#> [130,]    8    6    8   20   12
#> [131,]    8    8    8    8    8
#> [132,]    8    8    8    8    8
#> [133,]    8    8    8    8    8
#> [134,]   13    5    8   20   12
#> [135,]    8    6   21   13   16
#> [136,]    8    8    8    8    8
#> [137,]    8    8    8    8    8
#> [138,]    8    8    8    8    8
#> [139,]   10   12   23   17    8
#> [140,]    8    8    8    8    8
#> [141,]    8    8    8    8    8
#> [142,]   10    8    8    8    8
#> [143,]   10    8   22    8    8
#> [144,]    8    8    8    8    8
#> [145,]    8    8    8    8    8
#> [146,]    8    8    8    8    8
#> [147,]   10    8   12    8    8
#> [148,]    8    8    8    8    8
#> [149,]    8    8    8    8    8
#> [150,]   10    8   14    8    8