buildPredictor | R Documentation |
Build a Random Forest Classifier (RFC) of class
randomForest
.
buildPredictor(model, data, n = 10000, m = 3, vset = NULL, ...)
model |
An R formula of shape y ~ x1 + x2 + ... + xn.
You can use |
data |
A matrix or data.frame with subjects as rows and ultrasound features as columns. The outcome should be named "y". |
n |
Number of trees to be generated by bootstrap. |
m |
Number of randomly sampled variables per tree branching. |
vset |
An optional data.frame of the same shape as the input data.
This will be used as external validation set.
A validation set can be also extracted from the input dataset,
using the |
... |
Currently ignored. |
This is the class of RFC used in the
us.predict
and
rfc.predict
fuctions.
The default randomForest object in the morphonode
package
is an ensemble of 5 RFCs trained over a simulated dataset of
948 subjects (508 non-malignant and 440 malignant profiles), using
a nested 5-fold cross-validation scheme. The training/validation
details and performances of this dataset are stored in the
mpm.rfc
object.
A list of 2 objects:
"RFC", an object of class randomForest
;
"performance", a list containing RFC performances.
Fernando Palluzzi fernando.palluzzi@gmail.com
Fragomeni SM, Moro F, Palluzzi F, Mascilini F, Rufini V, Collarino A, Inzani F, Giacò L, Scambia G, Testa AC, Garganese G (2022). Evaluating the risk of inguinal lymph node metastases before surgery using the Morphonode Predictive Model: a prospective diagnostic study. Ultrasound xx Xxxxxxxxxx xxx Xxxxxxxxxx. 00(0):000-000. <https://doi.org/00.0000/00000000000000000000>
Liaw A, Wiener M. Classification and Regression by randomForest (2002). R News, 2(3):18-22. <https://doi.org/10.1023/A:1010933404324>
us.predict
,
rfc.predict
,
vpart
# Extract a subset of 500 subjects and an outcome vector of length 30 # from the default simulated dataset x <- mosaic::sample(mpm.us, 500, replace = FALSE, prob = NULL) x <- x[, 2:16] model <- formula("y ~ .") # Data partitioning (75% training set, 25% validation set) x <- vpart(x, p = 0.75) # RFC building (1000 bootstrapped trees, 3 random variables per split) rfc <- buildPredictor(model, x$training.set, n = 1000, vset = x$validation.set) print(rfc$performance) # RFC building (10000 bootstrapped trees, 3 random variables per split) rfc <- buildPredictor(model, x$training.set, vset = x$validation.set) print(rfc$performance)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.