No commit activity in last 3 years
No release in over 3 years
Implementation of the weighted Slope One collaborative filtering/recommendation algorithm.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Slope One (Recommendation Algorithm)

DESCRIPTION:

Ruby implementation of the Slope One recommendation algorithm. Ported from Bryan O’Sullivan's awesome Python implementation.

SYNOPSIS:

user_data = {
  "rob" => {
    "24" => 9.5,
    "Lost" => 8.2,
    "House" => 6.8
  },

  "bob" => {
    "24" => 3.7,
    "Big Bang Theory" => 2.1,
    "House" => 8.3
  },

  "tod" => {
    "24" => 9.5,
    "Lost" => 3.4,
    "House" => 5.5,
    "Big Bang Theory" => 9.3
  },

  "dod" => {
    "24" => 7.2,
    "Lost" => 5.1,
    "House" => 8.4,
    "The Event" => 7.8,
  }
}

slope_one = SlopeOne.new
slope_one.insert(user_data)
puts slope_one.predict({"House" => 3, "Big Bang Theory" => 7.5}).inspect

INSTALL:

gem install slope_one

or in your Gemfile:

gem 'slope_one'

LICENSE:

Copyright 2006 Bryan O'Sullivan bos@serpentine.com (Original implementation)
Copyright 2010 Ashley Williams hi@ashleyw.co.uk (Ruby port)

This software may be used and distributed according to the terms of the GNU General Public License, version 2 or later, which is incorporated herein by reference.