Metrics
An R package for common supervised machine learning metrics.
Install / Use
/learn @mfrasco/MetricsREADME
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. 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 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 |
|
Related Skills
proje
Interactive vocabulary learning platform with smart flashcards and spaced repetition for effective language acquisition.
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
400Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
