All Projects â†’ tlverse â†’ origami

tlverse / origami

Licence: GPL-3.0 License
🎲 🔮 Comprehensive Cross-Validation Engine

Programming Languages

r
7636 projects
TeX
3793 projects
Makefile
30231 projects

Projects that are alternatives of or similar to origami

resamplr
R package cross-validation, bootstrap, permutation, and rolling window resampling techniques for the tidyverse.
Stars: ✭ 35 (+40%)
Mutual labels:  cross-validation
Credit
An example project that predicts risk of credit card default using a Logistic Regression classifier and a 30,000 sample dataset.
Stars: ✭ 18 (-28%)
Mutual labels:  cross-validation
timeseries-cv
Time-Series Cross-Validation Module
Stars: ✭ 22 (-12%)
Mutual labels:  cross-validation
osprey
🦅Hyperparameter optimization for machine learning pipelines 🦅
Stars: ✭ 71 (+184%)
Mutual labels:  cross-validation
subsemble
subsemble R package for ensemble learning on subsets of data
Stars: ✭ 40 (+60%)
Mutual labels:  cross-validation
Machine-learning-toolkits-with-python
Machine learning toolkits with Python
Stars: ✭ 31 (+24%)
Mutual labels:  cross-validation
modeltime.resample
Resampling Tools for Time Series Forecasting with Modeltime
Stars: ✭ 12 (-52%)
Mutual labels:  cross-validation
assignPOP
Population Assignment using Genetic, Non-genetic or Integrated Data in a Machine-learning Framework. Methods in Ecology and Evolution. 2018;9:439–446.
Stars: ✭ 16 (-36%)
Mutual labels:  cross-validation
MNIST
Handwritten digit recognizer using a feed-forward neural network and the MNIST dataset of 70,000 human-labeled handwritten digits.
Stars: ✭ 28 (+12%)
Mutual labels:  cross-validation
san
Spatial Modelling for Data Scientists
Stars: ✭ 63 (+152%)
Mutual labels:  cross-validation
mlr3spatiotempcv
Spatiotemporal resampling methods for mlr3
Stars: ✭ 43 (+72%)
Mutual labels:  cross-validation
introduction-to-machine-learning
A document covering machine learning basics. 🤖📊
Stars: ✭ 17 (-32%)
Mutual labels:  cross-validation
sklearndf
DataFrame support for scikit-learn.
Stars: ✭ 54 (+116%)
Mutual labels:  cross-validation
glmnetUtils
Utilities for glmnet
Stars: ✭ 60 (+140%)
Mutual labels:  cross-validation
3D-UNet-PyTorch-Implementation
The implementation of 3D-UNet using PyTorch
Stars: ✭ 78 (+212%)
Mutual labels:  cross-validation
cvAUC
Computationally efficient confidence intervals for cross-validated AUC estimates in R
Stars: ✭ 22 (-12%)
Mutual labels:  cross-validation
numerics
library of numerical methods using Armadillo
Stars: ✭ 17 (-32%)
Mutual labels:  cross-validation
HAR
Recognize one of six human activities such as standing, sitting, and walking using a Softmax Classifier trained on mobile phone sensor data.
Stars: ✭ 18 (-28%)
Mutual labels:  cross-validation

R/origami

R-CMD-check Coverage Status CRAN CRAN downloads CRAN total downloads Project Status: Active - The project has reached a stable, usable state and is being actively developed. License: GPL v3 DOI DOI

High-powered framework for cross-validation. Fold your data like it’s paper!

Authors: Jeremy Coyle, Nima Hejazi, Ivana Malenica, and Rachael Phillips


What’s origami?

The origami R package provides a general framework for the application of cross-validation schemes to particular functions. By allowing arbitrary lists of results, origami accommodates a range of cross-validation applications.


Installation

For standard use, we recommend installing the package from CRAN via

install.packages("origami")

You can install a stable release of origami from GitHub via devtools with:

devtools::install_github("tlverse/origami")

Usage

For details on how best to use origami, please consult the package documentation and introductory vignette online, or do so from within R.


Example

This minimal example shows how to use origami to apply cross-validation to the computation of a simple descriptive statistic using a sample data set. In particular, we obtain a cross-validated estimate of the mean:

library(stringr)
library(origami)
#> origami v1.0.4: Generalized Framework for Cross-Validation
set.seed(4795)

data(mtcars)
head(mtcars)
#>                    mpg cyl disp  hp drat    wt  qsec vs am gear carb
#> Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
#> Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
#> Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
#> Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
#> Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
#> Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1
# build a cv_fun that wraps around lm
cv_lm <- function(fold, data, reg_form) {
  # get name and index of outcome variable from regression formula
  out_var <- as.character(unlist(str_split(reg_form, " "))[1])
  out_var_ind <- as.numeric(which(colnames(data) == out_var))

  # split up data into training and validation sets
  train_data <- training(data)
  valid_data <- validation(data)

  # fit linear model on training set and predict on validation set
  mod <- lm(as.formula(reg_form), data = train_data)
  preds <- predict(mod, newdata = valid_data)

  # capture results to be returned as output
  out <- list(coef = data.frame(t(coef(mod))),
              SE = ((preds - valid_data[, out_var_ind])^2))
  return(out)
}

folds <- make_folds(mtcars)
results <- cross_validate(cv_fun = cv_lm, folds = folds, data = mtcars,
                          reg_form = "mpg ~ .")
mean(results$SE)
#> [1] 15.18558

For details on how to write wrappers (cv_funs) for use with origami::cross_validate, please consult the documentation and vignettes that accompany the package.


Issues

If you encounter any bugs or have any specific feature requests, please file an issue.


Contributions

Contributions are very welcome. Interested contributors should consult our contribution guidelines prior to submitting a pull request.


Citation

After using the origami R package, please cite it:

    @article{coyle2018origami,
      author = {Coyle, Jeremy R and Hejazi, Nima S},
      title = {origami: A Generalized Framework for Cross-Validation in R},
      journal = {The Journal of Open Source Software},
      volume = {3},
      number = {21},
      month = {January},
      year  = {2018},
      publisher = {The Open Journal},
      doi = {10.21105/joss.00512},
      url = {https://doi.org/10.21105/joss.00512}
    }

License

© 2017-2021 Jeremy R. Coyle

The contents of this repository are distributed under the GPL-3 license. See file LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].