Description Usage Arguments Value Note References Examples
This function builds a random ferns model on the given training data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
x 
Data frame containing attributes; must have unique names and contain only numeric, integer or (ordered) factor columns.
Factors must have less than 31 levels. No 
... 
For formula and matrix methods, a place to state parameters to be passed to default method.
For the print method, arguments to be passed to 
formula 
alternatively, formula describing model to be analysed. 
data 
in which to interpret formula. 
y 
A decision vector. Must a factor of the same length as 
depth 
The depth of the ferns; must be in 1–16 range. Note that time and memory requirements scale with 
ferns 
Number of ferns to be build. 
importance 
Set to calculate attribute importance measure (VIM);

saveForest 
Should the model be saved? It must be 
consistentSeed 
PRNG seed used for shadow importance only.
Must be either a 2element integer vector or 
threads 
Number or OpenMP threads to use. The default value of 
An object of class rFerns
, which is a list with the following components:
model 
The built model; 
oobErr 
OOB approximation of accuracy. Ignores neverOOBtested objects (see oobScores element). 
importance 
The importance scores or 
oobScores 
A matrix of OOB scores of each class for each object in training set.
Rows correspond to classes in the same order as in 
oobPreds 
A vector of OOB predictions of class for each object in training set. NeverOOBtested objects (see above) have predictions equal to 
oobConfusionMatrix 
Confusion matrix build from 
timeTaken 
Time used to train the model (smaller than wall time because data preparation and model final touches are excluded; however it includes the time needed to compute importance, if it applies).
An object of 
parameters 
Numerical vector of three elements: 
classLabels 
Copy of 
consistentSeed 
Consistent seed used; only present for 
isStruct 
Copy of the train set structure, required internally by predict method. 
The unused levels of the decision will be removed; on the other hand unused levels of categorical attributes will be preserved, so that they could be present in the data later predicted with the model. The levels of ordered factors in training and predicted data must be identical.
Do not use formula interface for a data with large number of attributes; the overhead from handling the formula may be significant.
Ozuysal M, Calonder M, Lepetit V & Fua P. (2009). Fast Keypoint Recognition using Random Ferns, IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(3), 448461.
Kursa MB (2014). rFerns: An Implementation of the Random Ferns Method for GeneralPurpose Machine Learning, Journal of Statistical Software, 61(10), 113.
1 2 3 4 5 6 7 8 
Forest of 1000 ferns of a depth 5.
OOB error 5.33%; OOB confusion matrix:
True
Predicted setosa versicolor virginica
setosa 50 0 0
versicolor 0 45 3
virginica 0 5 47
MeanScoreLoss Shadow Tries
Sepal.Length 0.2630551 0.05195148 773
Sepal.Width 0.1811833 0.05247208 752
Petal.Length 0.5268230 0.04527552 777
Petal.Width 0.5471982 0.04377684 752
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.