Giter Site home page Giter Site logo

kevingmq / confusion-matrix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from habernal/confusion-matrix

0.0 1.0 0.0 22 KB

Minimalistic Java implementation of a confusion matrix for evaluating learning algorithms, including accuracy, macro F-measure, Cohen's Kappa, and probabilistic confusion matrix

License: Apache License 2.0

Java 100.00%

confusion-matrix's Introduction

confusion-matrix

A minimalistic Java implementation of confusion matrix for evaluating learning algorithms, including accuracy, macro F-measure, Cohen's Kappa, and probabilistic confusion matrix.

(c) Ivan Habernal

Licenced under ASL 2.0

Installation

Add this Maven dependency

<dependency>
  <groupId>com.github.habernal</groupId>
  <artifactId>confusion-matrix</artifactId>
  <version>1.0</version>
</dependency>

Usage

An example from http://www.compumine.se/web/public/newsletter/20071/precision-recall

     A  B  C
A  	25 	5 	2
B  	3 	32 	4
C  	1 	0 	15
ConfusionMatrix cm = new ConfusionMatrix();

cm.increaseValue("neg", "neg", 25);
cm.increaseValue("neg", "neu", 5);
cm.increaseValue("neg", "pos", 2);
cm.increaseValue("neu", "neg", 3);
cm.increaseValue("neu", "neu", 32);
cm.increaseValue("neu", "pos", 4);
cm.increaseValue("pos", "neg", 1);
cm.increaseValue("pos", "pos", 15);

System.out.println(cm);
System.out.println(cm.printLabelPrecRecFm());
System.out.println(cm.getPrecisionForLabels());
System.out.println(cm.getRecallForLabels());
System.out.println(cm.printNiceResults());

For other examples, see the JUnit Test in com.github.habernal.confusionmatrix.ConfusionMatrixTest

confusion-matrix's People

Contributors

habernal avatar

Watchers

Kevin Gustavo M. Q. 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.