Giter Club home page Giter Club logo

metricsweighted's Introduction

{MetricsWeighted}

CRAN status R-CMD-check Codecov test coverage

Overview

{MetricsWeighted} provides weighted and unweighted versions of metrics and performance measures for machine learning.

Installation

# From CRAN
install.packages("MetricsWeighted")

# Development version
devtools::install_github("mayer79/MetricsWeighted")

Usage

There are two ways to apply the package. We will go through them in the following examples. Please have a look at the vignette on CRAN for further information and examples.

Example 1: Standard interface

library(MetricsWeighted)

y <- 1:10
pred <- c(2:10, 14)

rmse(y, pred)            # 1.58
rmse(y, pred, w = 1:10)  # 1.93

r_squared(y, pred)       # 0.70
r_squared(y, pred, deviance_function = deviance_gamma)  # 0.78

Example 2: data.frame interface

Useful, e.g., in a {dplyr} chain.

dat <- data.frame(y = y, pred = pred)

performance(dat, actual = "y", predicted = "pred")

> metric    value
>   rmse 1.581139

performance(
  dat, 
  actual = "y", 
  predicted = "pred", 
  metrics = list(rmse = rmse, `R-squared` = r_squared)
)

>    metric     value
>      rmse 1.5811388
> R-squared 0.6969697

Check out the vignette for more applications.

metricsweighted's People

Contributors

mayer79 avatar

Watchers

James Cloos avatar CRAN robot avatar Kostas Georgiou avatar  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.