Socket
Socket
Sign inDemoInstall

precision-recall

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    precision-recall

JS percision, recall and F1 calculation library


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

precision-recall

Given two arrays of strings (don't have to be unique), will calculate the precision, recall and f1 values. Returned as an JSON object. If one of the arrays is empty (or falsy), will return { precision: 0, recall: 0, f: 0 }.

  • Install using "npm install precision-recall" or "yarn add precision-recall"
import precisionRecall from 'precision-recall';

// what we expect to get
const relevant = ['relevant1', 'relevant2'];
// what we actually got
const retrieved = ['relevant1', 'irrelevant1', 'irrelevant2'];

// call the func
const sentences = precisionRecall(relevant, retrieved);
// results in { precision: 0.3333333333333333, recall: 0.5, f: 0.4 }

Keywords

FAQs

Last updated on 01 May 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc