Skip to content

Commit 32b0a85

Browse files
committed
Updated kernel vignette to match interface update
1 parent f9999a9 commit 32b0a85

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vignettes/EnsembleKernel.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ bart_model <- bart(X_train=X_train, y_train=y_train, X_test=X_test, mean_forest_
102102
103103
# Extract kernels needed for kriging
104104
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)
106106
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)
108108
W_train <- sparseMatrix(i=rep(1:length(y_train),num_trees), j=leaf_mat_train + 1, x=1)
109109
W_test <- sparseMatrix(i=rep(1:length(y_test),num_trees), j=leaf_mat_test + 1, x=1)
110110
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_
179179
180180
# Extract kernels needed for kriging
181181
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)
183183
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)
185185
W_train <- sparseMatrix(i=rep(1:length(y_train),num_trees), j=leaf_mat_train + 1, x=1)
186186
W_test <- sparseMatrix(i=rep(1:length(y_test),num_trees), j=leaf_mat_test + 1, x=1)
187187
Sigma_11 <- tcrossprod(W_test) / num_trees

0 commit comments

Comments
 (0)