Code Monkey home page Code Monkey logo

gst's Introduction

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

GST

Arduino library for Gold Standard Test metrics.

Description

Note: experimental

The GST library is an implementation of the Gold Standard Test.

Links

These sites describe the functions in more detail.

Related

Performance

The math functions are from pretty straightforward to rather complex.

It is possible to optimize functions with intermediate values if needed. However the right way to optimize depends on the way the library is used.

Interface

#include "GST.h"

See .h file for all functions. Many function exist in a long descriptive name and an acronym version. Here only the long names are given.

For the definitions please check - https://en.wikipedia.org/wiki/Sensitivity_and_specificity or https://en.wikipedia.org/wiki/Confusion_matrix

Input functions

These four numbers should all be set before output functions make sense. The parameter value is typical absolute value measured or counted. If the parameter is omitted, the default 0 will be used to reset the value.

  • void setTruePositive(float value = 0) set the internal TP value.
  • void setTrueNegative(float value = 0) set the internal TN value.
  • void setFalsePositive(float value = 0) set the internal FP value.
  • void setFalseNegative(float value = 0) set the internal FN value.
  • void clearAll() reset all the above to 0.

In tests one often want to increase / change the numbers. This can be done with the addTruePositive() etc functions. After every addition all output functions can be called.

  • float addTruePositive(float value) increases the internal TP value. Use a negative value to decrease. Returns the new value of TP.
  • float addTrueNegative(float value) increases the internal TN value. Use a negative value to decrease. Returns the new value of TN.
  • float addFalsePositive(float value) increases the internal FP value. Use a negative value to decrease. Returns the new value of FP.
  • float addFalseNegative(float value) increases the internal FN value. Use a negative value to decrease. Returns the new value of FN.

Output functions I

Basic output

  • float getTruePositive() returns internal TP.

  • float getTrueNegative() returns internal TN.

  • float getFalsePositive() returns internal FP.

  • float getFalseNegative() returns internal FN.

  • float getTotal() returns total of four numbers.

  • float getActualPositive()

  • float getActualNegative()

  • float getTestedPositive()

  • float getTestedNegative()

  • float sensitivity() equals truePositiveRate().

  • float specificity() equals trueNegativeRate()

Rate functions can be multiplied by 100.0 to get percentage.

  • float truePositiveRate() returns value between 0.0 and 1.0
  • float trueNegativeRate() returns value between 0.0 and 1.0
  • float falseNegativeRate() returns value between 0.0 and 1.0
  • float falsePositiveRate() returns value between 0.0 and 1.0

Output functions II

These output functions are the more 'complex' functions. Read the Wikipedia pages for their uses.

  • float positivePredictiveValue()

  • float negativePredictiveValue()

  • float falseDiscoveryRate()

  • float falseOmissionRate()

  • float positiveLikelihoodRatio()

  • float negativeLikelihoodRatio()

  • float prevalenceThreshold()

  • float threatScore()

  • float criticalSuccessIndex()

  • float prevalence()

  • float accuracy()

  • float balancedAccuracy()

  • float F1Score()

  • float MatthewsCorrelationCoefficient()

  • float FowlkesMallowsIndex()

  • float BookmakerInformedness()

  • float markedness()

  • float deltaP()

  • float diagnosticOddsRatio()

Future

Must

  • improve documentation

Should

  • add functions
    • percentage functions for TP TN FP and FN?
  • test
    • complete the CI test coverage.

Could

  • examples
    • add real life examples.
    • combination with a sensor? batch testing?

Wont

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,

gst's People

Contributors

robtillaart avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.