Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bearloga/mlpugs
An R package for Multi-Label Prediction Using Gibbs Sampling (and Classifier Chains)
https://github.com/bearloga/mlpugs
classification machine-learning mcmc multi-label-classification r r-package rstats supervised-learning
Last synced: about 1 month ago
JSON representation
An R package for Multi-Label Prediction Using Gibbs Sampling (and Classifier Chains)
- Host: GitHub
- URL: https://github.com/bearloga/mlpugs
- Owner: bearloga
- License: other
- Created: 2015-04-21T16:02:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-06T17:45:12.000Z (over 4 years ago)
- Last Synced: 2024-10-12T18:00:27.147Z (about 1 month ago)
- Topics: classification, machine-learning, mcmc, multi-label-classification, r, r-package, rstats, supervised-learning
- Language: R
- Homepage: http://www.mpopov.com/mlpugs
- Size: 110 KB
- Stars: 11
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MLPUGS
Multi-Label Prediction Using Gibbs Sampling (and Classifier Chains)An implementation of classifier chains (CC's) for multi-label prediction. Users can employ an external package (e.g. 'randomForest', 'C50'), or supply their own. The package can train a single set of CC's or train an ensemble of CC's -- in parallel if running in a multi-core environment. New observations are classified using a Gibbs sampler since each unobserved label is conditioned on the others. The package includes methods for evaluating the predictions for accuracy and aggregating across iterations and models to produce binary or probabilistic classifications.
## Installation
```R
# install.packages("remotes")
remotes::install_github("bearloga/MLPUGS")
```## Basic Usage
```R
fit <- ecc(x, y)
preds <- predict(fit, x_new)
y_pred <- summary(preds)
```For a detailed tutorial, please see `browseVignettes(package="MLPUGS")`.
### External Classifiers
Currently, there is no built-in classifier in version 0.1.1, but users can supply their own or use an existing package. For example:
```R
# Random Forest:
foo_train <- function(x, y) randomForest::randomForest(x, y)
foo_predict <- function(x, newdata) randomForest:::predict.randomForest(x, newdata, type = "prob")# C5.0:
foo_train <- function(x, y) C50::C5.0(x, y)
foo_predict <- function(x, newdata) C50::predict.C5.0(x, newdata, type = "prob")fit <- ecc(x, y, .f = foo_train)
pugs <- predict(fit, x_new, .f = foo_predict)
y_pred <- summary(pugs, type = "prob")y_pred <- ecc(x, y, .f = foo_train) %>%
predict(x_new, .f = foo_predict) %>%
summary(type = "prob")
```## Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.