Giter Club home page Giter Club logo

yardstick's Introduction

yardstick

Build Status Coverage Status CRAN_Status_Badge Downloads

yardstick is a package to estimate how well models are working using tidy data principals. The package webpage is https://topepo.github.io/yardstick/ for more information.

For example, suppose you create a classification model and predict a data set. You might have data that look like this:

library(yardstick)
library(dplyr)

head(two_class_example)
##    truth  Class1   Class2 predicted
## 1 Class2 0.00359 0.996411    Class2
## 2 Class1 0.67862 0.321379    Class1
## 3 Class2 0.11089 0.889106    Class2
## 4 Class1 0.73516 0.264838    Class1
## 5 Class2 0.01624 0.983760    Class2
## 6 Class1 0.99928 0.000725    Class1

You can use a dplyr-like syntax to compute common performance characteristics of the model and get them back in a data frame:

metrics(two_class_example, truth, predicted)
## # A tibble: 1 x 2
##   accuracy kappa
##      <dbl> <dbl>
## 1    0.838 0.675
# or 

two_class_example %>% roc_auc(truth, Class1)
## [1] 0.939

Quasiquotation can also be used:

# probability columns:
lvl <- levels(two_class_example$truth)

two_class_example %>% mnLogLoss(truth, !! lvl)
## [1] -0.328

Installation

To install the package:

install.packages("yardstick")

## for development version:
require("devtools")
install_github("topepo/yardstick")

yardstick's People

Contributors

topepo avatar csetraynor avatar pierreroudier avatar batpigandme avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.