Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njtierney/broomstick
:evergreen_tree: broom helpers for decision tree methods (rpart, randomForest, and more!) :evergreen_tree:
https://github.com/njtierney/broomstick
broom decision-trees gbm machine-learning randomforest rpart rstats statistical-learning
Last synced: 16 days ago
JSON representation
:evergreen_tree: broom helpers for decision tree methods (rpart, randomForest, and more!) :evergreen_tree:
- Host: GitHub
- URL: https://github.com/njtierney/broomstick
- Owner: njtierney
- License: other
- Created: 2017-08-23T13:27:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-03T06:27:24.000Z (12 months ago)
- Last Synced: 2024-10-12T21:19:47.885Z (about 1 month ago)
- Topics: broom, decision-trees, gbm, machine-learning, randomforest, rpart, rstats, statistical-learning
- Language: R
- Homepage: http://broomstick.njtierney.com/
- Size: 88.9 KB
- Stars: 28
- Watchers: 10
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```# broomstick
[![R build status](https://github.com/njtierney/broomstick/workflows/R-CMD-check/badge.svg)](https://github.com/njtierney/broomstick/actions)
[![Codecov test coverage](https://codecov.io/gh/njtierney/broomstick/branch/master/graph/badge.svg)](https://codecov.io/gh/njtierney/broomstick?branch=master)
[![R-CMD-check](https://github.com/njtierney/broomstick/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/njtierney/broomstick/actions/workflows/R-CMD-check.yaml)Convert decision tree objects into tidy data frames with `broomstick`.
The goal of broomstick is to extend the [`broom`](https://github.com/tidyverse/broom) package to work with decision trees. It is currently borrowing heavily from the prototype package [`treezy`](https://github.com/njtierney/treezy).
## Installation
You can install broomstick from github with:
```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("njtierney/broomstick")
```## Examples
## rpart
```{r example-rpart}
library(rpart)
library(broomstick)fit_rpart <- rpart(Kyphosis ~ Age + Number + Start,
data = kyphosis)tidy(fit_rpart)
augment(fit_rpart)
```## gbm (Boosted Regression Tree)
```{r example-gbm}
library(gbm)
library(MASS)
fit_gbm <- gbm(calories ~., data = UScereal)tidy(fit_gbm)
```## random forest
```{r example-rf}
library(randomForest)
ozone_rf <- randomForest(Ozone ~ .,
data = airquality,
importance = TRUE,
na.action = na.omit)
tidy(ozone_rf)
glance(ozone_rf)
augment(ozone_rf)
```