Git Product home page Git Product logo

py-metric's Introduction

pymetric

The Python module to common measurement methods.

Installation

$ sudo python setup.py install

or alternatively building module

$ python setup.py build

Getting Started

>>> from pymetric import AllMetrics
>>> A = [1, 0, 1]
>>> B = [1, 0, 0]
>>> AllMetrics.measure(A, B, 'rmse')
0.57735026918962573
>>> AllMetrics.measure(A, B, 'ap')
0.83333333333333326

API Reference

The all_in_one interface of pymetric is AllMetrics.measure(y_truth, y_pred, method).

  • y_truth : a list of int/float, or filename that contains a value each line.
  • y_pred : a list of float, or filename that contains a value each line.
  • method : several options as follows:

Group 1

Group 1 is for regression task. Inputs of y_truth should be a list of floats.

  • abs_error : AbsError.abs_error
  • rmse : RMSE.rmse
  • r2 : R2.r2
  • ndcg : NDCG.ndcg
  • cos : Cosine.cos

Group 2

Group 2 is for classification task. Inputs of y_truth should be a list of 0-1 values.

  • precision : PR.precision
  • recall : PR.recall
  • f1_score : PR.f1_score
  • ap : MAP.ap
  • auc : AUC.auc
  • ndcg : NDCG.ndcg

TODO list:

##Author

pymetric is developed and maintained by Zuotao Liu ([email protected]).

py-metric's People

Contributors

fancyspeed avatar

Watchers

James Cloos avatar Jolin Xia 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.