Socket
Socket
Sign inDemoInstall

bayesian-network

Package Overview
Dependencies
5
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bayesian-network

A simple Bayesian Network classifer based on Baye's rule and the conditional independence assumption.


Version published
Maintainers
1
Install size
21.7 MB
Created

Readme

Source

Bayesian Network

A simple Bayesian network based on Baye's rule and the conditional independence assumption.

Example Usage

const classifier = new BayesianNetwork();

classifier.addDocument("hello you are amazing", "positive");
classifier.addDocument("today is a beautiful day", "positive");
classifier.addDocument("its dark out today", "negative");
classifier.addDocument("today was bad", "negative");

classifier.calculateLogFrequencies();

console.log(classifier.classify('hello you are great'));

/*
{
  classification: { label: 'POSITIVE', value: -6.238324625039508 },
  labels: { POSITIVE: -6.238324625039508, NEGATIVE: -6.238324625039508 }
}
*/

Keywords

FAQs

Last updated on 10 Apr 2020

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