algorithms Package

base Module

class recommends.algorithms.base.BaseAlgorithm[source]

Bases: object

cache
calculate_recommendations(vote_list, itemMatch)[source]

itemMatch is supposed to be the result of calculate_similarities()

Returns a list of recommendations:

[
    (<user1>, [
        ("<object_identifier1>", <score>),
        ("<object_identifier2>", <score>),
    ]),
    (<user2>, [
        ("<object_identifier1>", <score>),
        ("<object_identifier2>", <score>),
    ]),
]
calculate_similarities(vote_list, verbose=0)[source]

Must return an dict of similarities for every object:

Accepts a vote matrix representing votes with the following schema:

[
    (<user1>, "<object_identifier1>", <score>),
    (<user1>, "<object_identifier2>", <score>),
]

Output must be a dictionary with the following schema:

[
    ("<object_identifier1>", [
                    ("<related_object_identifier2>", <score>),
                    ("<related_object_identifier3>", <score>),
    ]),
    ("<object_identifier2>", [
                    ("<related_object_identifier1>", <score>),
                    ("<related_object_identifier3>", <score>),
    ]),
]
clear_cache()[source]

ghetto Module

class recommends.algorithms.ghetto.GhettoAlgorithm(*args, **kwargs)[source]

Bases: recommends.algorithms.naive.NaiveAlgorithm

pyrecsys Module