| NNS.boost | R Documentation |
Ensemble method for classification using the NNS multivariate regression NNS.reg as the base learner instead of trees.
NNS.boost(
IVs.train,
DV.train,
IVs.test = NULL,
type = NULL,
depth = NULL,
learner.trials = 100,
epochs = NULL,
CV.size = NULL,
balance = FALSE,
ts.test = NULL,
threshold = NULL,
obj.fn = expression(sum((predicted - actual)^2)),
objective = "min",
extreme = FALSE,
features.only = FALSE,
feature.importance = TRUE,
pred.int = NULL,
status = TRUE,
seed = 123L,
dist = NULL,
folds = 5
)
IVs.train |
a matrix or data frame of variables of numeric or factor data types. |
DV.train |
a numeric or factor vector with compatible dimensions to |
IVs.test |
a matrix or data frame of variables of numeric or factor data types with compatible dimensions to |
type |
|
depth |
options: (integer, NULL, "max"); |
learner.trials |
integer; 100 (default) Sets the number of trials to obtain an accuracy |
epochs |
integer; |
CV.size |
numeric [0, 1]; |
balance |
logical; |
ts.test |
integer; NULL (default) Sets the length of the test set for time-series data; typically |
threshold |
numeric [0, 1]; |
obj.fn |
expression;
|
objective |
options: ("min", "max") |
extreme |
logical; |
features.only |
logical; |
feature.importance |
logical; |
pred.int |
numeric [0,1]; |
status |
logical; |
seed |
Optional integer random seed used for reproducible resampling, fold construction, and stochastic fitting steps. If 'NULL', the current random-number-generator state is used. |
dist |
options:(NULL, "NNS", "L1", "L2", "FACTOR") the method of distance calculation passed to delegated NNS.reg and NNS.stack calls. |
folds |
integer; 5 (default) Number of cross-validation |
Returns a vector of fitted values for the dependent variable test set $results, prediction intervals $pred.int, the final feature loadings $feature.weights, final feature frequencies $feature.frequency, and (for classification) the class labels $class.levels. Classification results are numeric: a factor or character DV.train yields integer class codes with a base category of 1 (label recoverable as class.levels[results]), and a numeric DV.train yields its original numeric class values.
Like a logistic regression, the (type = "CLASS") setting is not necessary for target variable of two classes e.g. [0, 1]. The response variable base category should be 1 for classification problems.
Incorporate any objective function from external packages (such as Metrics::mape) via NNS.boost(..., obj.fn = expression(Metrics::mape(actual, predicted)), objective = "min")
Fred Viole, OVVO Financial Systems
Viole, F. (2016) "Classification Using NNS Clustering Analysis" \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2139/ssrn.2864711")}
## Using 'iris' dataset where test set [IVs.test] is 'iris' rows 141:150.
## Not run:
a <- NNS.boost(iris[1:140, 1:4], iris[1:140, 5],
IVs.test = iris[141:150, 1:4],
epochs = 100, learner.trials = 100,
type = "CLASS", depth = NULL, balance = TRUE)
## Test accuracy
mean(a$results == as.numeric(iris[141:150, 5]))
## Recover the labels
a$class.levels[a$results]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.