mobForest v1.3.1

0

Monthly downloads

0th

Percentile

Model Based Random Forest Analysis

Functions to implements random forest method for model based recursive partitioning. The mob() function, developed by Zeileis et al. (2008), within 'party' package, is modified to construct model-based decision trees based on random forests methodology. The main input function mobforest.analysis() takes all input parameters to construct trees, compute out-of-bag errors, predictions, and overall accuracy of forest. The algorithm performs parallel computation using cluster functions within 'parallel' package.

Readme

mobForest

travis-ci build status CRAN statusbadge

mobForest R Package

mobForest implements random forest method for model based recursive partitioning. The mob() function, developed by Zeileis et al (2008), within party package, is modified to construct model-based decision trees based on random forests methodology. The main input function mobforest.analysis() takes all input parameters to construct trees, compute out-of-bag errors, predictions, and overall accuracy of forest. The algorithm performs parallel computation using clusterApply() function within the parallel package.

Installation

install.packages("mobForest")

Usage

To run the example, you will need the mlbench package. It contains a boston housing dataset for machine learning algorithms to run benchmark tests on.

library(mlbench)
set.seed(1111)
# Random Forest analysis of model based recursive partitioning load data
data("BostonHousing", package = "mlbench")
BostonHousing <- BostonHousing[1:90, c("rad", "tax", "crim", "medv", "lstat")] 

# Recursive partitioning based on linear regression model medv ~ lstat with 3 trees.  1 core/processor used. 
rfout <- mobforest.analysis(as.formula(medv ~ lstat), c("rad", "tax", "crim"),
mobforest_controls = mobforest.control(ntree = 3, mtry = 2, replace = TRUE,
        alpha = 0.05, bonferroni = TRUE, minsplit = 25), data = BostonHousing,
        processors = 1, model = linearModel, seed = 1111)
rfout

Functions in mobForest

Name Description
compute.acc Predictive accuracy estimates across trees for logistic regression model
compute.r2 Predictive accuracy estimates across trees for linear or poisson regression
compute.mse Predictive accuracy estimates (MSE) across trees for linear or poisson regression model.
mob_fit_checksplit Utility Function. Taken from party package to remove ":::" warning
mob_fit_childweights Utility Function. Taken from party package to remove ":::" warning
mobforest.output Model-based random forest object
mobforest.output-class Class "mobforest.output" of mobforest model
residual.plot Produces two plots: a) histogram of residuals, b) predicted Vs residuals. This feature is applicable only when linear regression is considered as the node model.
mobforest.control-class Class "mobforest.control" of mobForest model
mobforest.control Control parameters for random forest
string.formula Model in the formula object converted to a character
get.pred.values Get predictions summarized across trees for out-of-bag cases or all cases for cases from new test data
get.varimp Variable importance scores computed through random forest analysis
prediction.output-class Class "prediction.output" of mobForest model
mob_fit_splitnode Utility Function. Taken from party package to remove ":::" warning
mobforest.analysis Model-based random forest analysis
tree.predictions Predictions from tree model
varimp.output Variable importance matrix containing the decrease in predictive accuracy after permuting the variables across all trees
varimp.output-class Class "varimp.output" of mobforest model
varimplot A plot with variable importance score on X-axis and variable name on Y-axis.
prediction.output Predictions and predictive accuracy estimates
mob_fit_fluctests Utility Function. Taken from party package to remove ":::" warning
mob_fit_getlevels Utility Function. Taken from party package to remove ":::" warning
print.estimates Predictive Accuracy Report
predictive.acc Predictive performance across all trees
get.mf.object.glm Fit a general linear model to a mobForest model
get.mf.object.lm Fit a linear model to a mobForest model
mob_fit_getobjfun Utility Function. Taken from party package to remove ":::" warning
mob_fit_setupnode Utility Function. Taken from party package to remove ":::" warning
logistic.acc Contingency table: Predicted vs. Observed Outcomes
bootstrap This method computes predicted outcome for each observation in the data frame using the tree model supplied as an input argument.
mob.rf.tree Model based recursive partitioning - randomized subset of partition variables considered during each split.
No Results!

Last month downloads

Details

Type Package
Date 2019-07-31
License GPL (>= 2)
RoxygenNote 6.1.1
NeedsCompilation no
Packaged 2019-07-31 20:21:51 UTC; krjones
Repository CRAN
Date/Publication 2019-07-31 21:10:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/mobForest)](http://www.rdocumentation.org/packages/mobForest)