Giter VIP home page Giter VIP logo

bayes_on_redis's Introduction

What is BayesOnRedis?

Bayesian classifier on top of Redis

Why on Redis?

Redis is a persistent, in-memory, key-value store with support for various data structures such as lists, sets, and ordered sets. All these data types can be manipulated with atomic operations to push/pop elements, add/remove elements, perform server-side union, intersection, difference between sets, and so forth.

Because of Redis' properties:

  • It is extremely easy to implement simple algorithm such as bayesian filter.

  • The persistence of Redis means that the Bayesian implementation can be used in real production environment.

  • Even though I don't particularly care about performance at the moment, Redis benchmarks give me confidence that the implementation can scale to relatively large training data.

How to install? (Ruby version)

gem install bayes_on_redis

Getting started

# Require BayesOnRedis and RubyGems
require "rubygems"
require "bayes_on_redis"

# Create instance of BayesOnRedis and pass your Redis information.
# Of course, use real sentences for much better accuracy.
# Unless if you want to train spam related things.
bor = BayesOnRedis.new(:redis_host => '127.0.0.1', :redis_port => 6379, :redis_db => 0)

# Teach it
bor.train "good", "sweet awesome kick-ass cool pretty smart"
bor.train "bad", "sucks lame boo death bankrupt loser sad"

# Then ask it to classify text.
bor.classify("awesome kick-ass ninja can still be lame.")

for Pythonistas

BayesOnRedis is also available in Python. With the same API.

easy_install bayes_on_redis

Contributing

Fork http://github.com/didip/bayes_on_redis and send pull requests.

bayes_on_redis's People

Contributors

didip avatar joechrysler avatar

Watchers

 avatar  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.