# NOT RUN {
# Find the optimal tuning parameters.
n = 500; p = 10
X = matrix(rnorm(n*p), n, p)
Y = X[,1] * rnorm(n)
forest = regression_forest(X,Y)
tuned.lambda = tune_ll_regression_forest(forest)
# Use this parameter to predict from a local linear forest.
predictions = predict(forest, linear.correction.variables = 1:p, lambda = tuned.lambda)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab