0

Using randomForest, I want to create a low-level projection of the instance proximities, as produced by MDSPlot(). However, I not only want the training proximities, but proximities between all the instances (i.e. training and test). How can I do this?

I currently use xtest as argument to randomForest() and when I do

print("testProx")
print(rfmodel$test$prox)
print("trainProx")
print(rfmodel$prox)

I get

[1] "testProx"
[1] 119 239
[1] "trainProx"
[1] 120 120

So the distance from test to all is calculcated (119x239), but not from train to all (120x239). Instead, I only get from train to train (120x120). How can I get the full matrix all to all (239x239)?

To get the missing piece, I could copy the appropriate submatrix of test to all (i.e. test to train, 119x120) and use its transpose to plug it in to make the full matrix. But I was wondering if there was an easier way?

0 Answers0