https://github.com/mfrasco/Metrics
An R package for common supervised machine learning metrics.
https://github.com/mfrasco/Metrics
Last synced: 5 months ago
JSON representation
An R package for common supervised machine learning metrics.
- Host: GitHub
- URL: https://github.com/mfrasco/Metrics
- Owner: mfrasco
- License: other
- Created: 2017-10-22T02:10:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-25T18:10:02.000Z (over 5 years ago)
- Last Synced: 2024-10-28T17:24:46.655Z (6 months ago)
- Language: R
- Homepage:
- Size: 354 KB
- Stars: 99
- Watchers: 5
- Forks: 26
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - mfrasco/Metrics - An R package for common supervised machine learning metrics. (R)
README
# Metrics

[](https://cran.r-project.org/package=Metrics)
[](https://cran.rstudio.com/web/packages/Metrics/)## How to Install this Package
This package is distributed from CRAN. From the R prompt, run `install.packages("Metrics")`.
## Metrics Repo
This repository contains code for the **Metrics** package in R. **Metrics** was created by Ben Hamner and came from [this github repo](https://github.com/benhamner/Metrics/). Hamner's repo contains packages for common machine learning metrics in several programming languages, not just R. On 2017-04-21, CRAN orphaned the R package. To revive the status of the R package, I cloned the original and created this repo. I have added new metrics, improved documentation, and fixed bugs. This repository will be the home of active development on the **Metrics** R package moving forward.
## Community Feedback
If you notice anything wrong with the **Metrics** package or have any ideas on how to improve it, please create an issue in this github repository that describes your issue. I also welcome improvements to this package via a pull request. This is a simple R package, which makes it perfect for first time open source contributors. [Here is a guide](https://opensource.guide/how-to-contribute/) that walks you through how to make an open source contribution.
## What Metrics are Included in this Package?
All functions in the **Metrics** package take at least two arguments: `actual` and `predicted`. In the table below, I abbreviate `actual` as x and `predicted` as y for the sake of mathematical brevity.
| Metric Type | Metric Name | Function Name | Formula |
| ---- | ------------------------ | ---- | ------------------------------- |
| regression | Squared Error | se |  |
| regression | Mean Squared Error | mse |  |
| regression | Root Mean Squared Error | rmse |  |
| regression | Absolute Error | ae |  |
| regression | Mean Absolute Error | mae |  |
| regression | Absolute Percent Error | ape |  |
| regression | Mean Absolute Percent Error | mape |  |
| regression | Symmetric Mean Absolute Percent Error | smape |  |
| regression | Squared Log Error | sle |  |
| regression | Mean Squared Log Error | msle |  |
| regression | Root Mean Squared Log Error | rmsle |  |
| regression | Relative Squared Error | rse |  |
| regression | Root Relative Squared Error | rrse |  |
| regression | Relative Absolute Error | rae |  |
| time series | Mean Absolute Scaled Error | mase | |
| classification | Classification Error | ce |  |
| classification | Accuracy | accuracy |  |
| classification | F1 Score | f1 |  |
| binary classification | Area Under ROC Curve | auc | . `help(auc)` for details. |
| binary classification | Log Loss | ll |  |
| binary classification | Mean Log Loss | logloss |  |
| binary classification | Precision | precision |  |
| binary classification | Recall | recall |  |
| binary classification | F-beta Score | fbeta_score |  |