Giter Club home page Giter Club logo

ml-perf-metric's Introduction

ml-perf-metric

This repo contains a python script to calculate standard performance metrics used in machine learning applications.

The file myfunctions.py contains perfMetrics(pred,Y) which takes the predictions (pred) and true labels (Y) to calculate:

  • AUC ROC (Area Under the Receiver Operating Curve).
  • AUC PRC (Area Under the Precision Recall Curve).
  • Accuracy: Correct classification, when the probability threshold is set to 0.5 for classification between binary classes.
  • F1_score (binary, micro, and macro) : The harmonic mean of Precision and Recall.
  • TP (True Positive): Number of observations in positive class (i.e. class of interest) correctly as positive class.
  • FP (False Positive): Number of observations in negative class wrongly predicted as positive.
  • TN (True Negative): Number of observations in negative class correctly predicted as negative.
  • FN (False Negative): Number of observations in negative class wrongly predicted as negative.
  • FPR (False Positive Rate): Out of all the negative observations, the percentage of which were wrongly predicted positive.
  • TPR (True Positive Rate) : Out of all the positive observations, the percentage of which were correctly predicted positive.
  • Recall : (Same as True Positive Rate).
  • Precision: Out of all positive predictions, the the percentage of which were correctly predicted positive.
  • F1_score : The harmonic mean of Precision and Recall.
  • TPR_when_FPR0p10 : True Positive Rate at 0% False Positive Rate.
  • TPR_when_FPR0p05 : True Positive Rate at 1% False Positive Rate.
  • TPR_when_FPR0 : True Positive Rate at 5% False Positive Rate.
  • Brier Score: mean squared error.
  • HL_test (Hosmer-Lemeshow Test) : evaluates goodness-of-fit of model, i.e. if the model predicts 10% probability of a positive class for an observation, is the model correctly predicting the positive class 10% of the time?

ml-perf-metric's People

Contributors

talhanai avatar

Watchers

 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.