nodeHarvest: Node Harvest
Computes the node harvest estimator
nodeHarvest(X, Y, nodesize = 10,
nodes = 1000,
maxinter = 2,
mode = "mean",
lambda = Inf,
addto = NULL,
onlyinter = NULL,
silent = FALSE,
biascorr = FALSE)
A n x p - dimensional data matrix, where n is sample size and p is the dimensionality of the predictor variable.
Factorial variables are currently converted to numerical variables (will be changed in the future).
Missing values are supported.
A numerical vector of length n, containing the observations of the response variable.
Can be continuous (regression) or binary 0/1 (classification).
Minimal number of samples in each node.
Number of nodes in the initial large ensemble of nodes.
Maximal interaction depth
(1 = only main effects; 2 = two-factor interactions etc).
If mode is equal to
"mean", predictions are weighted group means. If equal to
"outbag" (experimental version), the diagonal elements of the smoothing matrix are set to 0.
Optional upper bound on the inverse of the average weighted fraction of samples within each node.
A previous node harvest estimator to which additional nodes should be attached
(useful for iterative growth of the estimator when hitting memory constraints).
Allow interactions only for this list of variables.
TRUE, no comments are printed.
Use bias correction? Experimental. Can be useful for high signal-to-noise ratio data.
A list with entries
- A list of all selected nodes
- Predicted values on training data
- Connectivity matrix between selected nodes (used for plotting)
- Variable names
- The original observations
The number of nodes should be chosen as large as possible under the available computational resources.
If these resources are limited, an estimator can be build by iteratively calling the function, adding the previous
estimator via the
Feedback and feature requests are more than welcome (email below).
## Load Boston Housing dataset
X <- BostonHousing[,1:13]
Y <- BostonHousing[,14]
## Divide data into training and test data
n <- nrow(X)
training <- sample(1:n,round(n/2))
testing <- (1:n)[-training]
## Train Node Harvest and plot and print the estimator
NH <- nodeHarvest( X[training,], Y[training], nodes=500 )
## Predict on test data and explain prediction of the first sample in the test set
predicttest <- predict(NH, X[testing,], explain=1)
plot( predicttest, Y[testing] )