@@ -102,9 +102,9 @@ bart_model <- bart(X_train=X_train, y_train=y_train, X_test=X_test, mean_forest_
102
102
103
103
# Extract kernels needed for kriging
104
104
leaf_mat_train <- computeForestLeafIndices(bart_model, X_train, forest_type = "mean",
105
- forest_inds = bart_model$model_params$num_samples)
105
+ forest_inds = bart_model$model_params$num_samples - 1 )
106
106
leaf_mat_test <- computeForestLeafIndices(bart_model, X_test, forest_type = "mean",
107
- forest_inds = bart_model$model_params$num_samples)
107
+ forest_inds = bart_model$model_params$num_samples - 1 )
108
108
W_train <- sparseMatrix(i=rep(1:length(y_train),num_trees), j=leaf_mat_train + 1, x=1)
109
109
W_test <- sparseMatrix(i=rep(1:length(y_test),num_trees), j=leaf_mat_test + 1, x=1)
110
110
Sigma_11 <- tcrossprod(W_test) / num_trees
@@ -179,9 +179,9 @@ bart_model <- bart(X_train=X_train, y_train=y_train, X_test=X_test, mean_forest_
179
179
180
180
# Extract kernels needed for kriging
181
181
leaf_mat_train <- computeForestLeafIndices(bart_model, X_train, forest_type = "mean",
182
- forest_inds = bart_model$model_params$num_samples)
182
+ forest_inds = bart_model$model_params$num_samples - 1 )
183
183
leaf_mat_test <- computeForestLeafIndices(bart_model, X_test, forest_type = "mean",
184
- forest_inds = bart_model$model_params$num_samples)
184
+ forest_inds = bart_model$model_params$num_samples - 1 )
185
185
W_train <- sparseMatrix(i=rep(1:length(y_train),num_trees), j=leaf_mat_train + 1, x=1)
186
186
W_test <- sparseMatrix(i=rep(1:length(y_test),num_trees), j=leaf_mat_test + 1, x=1)
187
187
Sigma_11 <- tcrossprod(W_test) / num_trees
0 commit comments