Giter Site home page Giter Site logo

naive-apl's Introduction

Naive Bayesian Classifier in APL

License MIT © 2015-2016 Matthew Cunningham

About

This is a simple naive bayesian classifier to gain independent probabilistic assumptions on test input. The classifier requires precisely 2 groups with training data. This is just a fun side project I did over the weekend, but any contributions would be fantastic.

There are three files in this repository — each file works on its own:

  • bayes.min.apl - This is the completely minified version.
  • bayes.apl - This file isn't as obfuscated as the minified version, but it still follows conventional minified APL practices.
  • bayes.full.apl - Fully documented

Example

This example shows the classifier displaying the independent probabilistic assumptions on whether given text aligns with keywords of two different animals: cat or dog.

$ ("meow purr hiss bad animal" 0) ("bark grr howl good animal" 1) b "I am an animal and I hiss"
0.9999999995 4.999999994999999e¯10

Try out this example using ngn/apl's online interpreter.

The provided training data is the keywords and groups, with cat being the 0th index and dog being the 1st index. The test data consists of a string that contains keywords to align with a certain training group; in this example, cat is the classified group.

naive-apl's People

Contributors

mattcunningham avatar

Watchers

James Cloos avatar 500-9 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.