Skip to main content

A library that provides an easy ready-to-use Recommendation engine.

Project description

Introduction

This library provides a pure Python interface for a Generalized Recommendation system.

Recommender Systems

Recommender Systems are algorithms aimed at suggesting relevant items to users (items being products to buy, movies to watch, text to read or anything else depending on industries). There exist two major categories of methods

  1. Content based methods
  2. Collaborative filtering methods

Content Based Recommendation

Content based approaches use additional information about users and/or items. The major idea of content based methods is to try to build a model, based on the available “features”, that explain the observed user-item interactions.

Collaborative Filtering Methods

Collaborative methods for recommender systems are methods that are based solely on the past interactions recorded between users and items in order to produce new recommendations.

Installing

pip install py-recommendation

Usage

Module Import

import py_recommendation as prc

Fetch the Input Data

Generate input data object which can be used for various types of recommendations available

Items Data

itemsInitialise = prc.ItemData()

Configure Data

# Reffer from sample data given below:
sample_items_data = {"title":['Place-A','Place-B','Place-C','Place-D','Place-E','Place-F','Place-G'],
            "tags":[
                'party & dance, nightlife, food, bar & restaurant, enjoy family',
                'Historic old monument, landmarks & enjoy$ beautiful',
                'Beach party, bar & nightlife @water, Beautiful',
                'Old Historic Temple, peaceful & rest, Family vacation',
                'Nature waterfall & green, beauty water',
                'Beautiful Himalaya hills, nature snow, water & peace',
                'Sights & Landmarks, Monuments & Statues'
            ]
           }
itemData = itemsInitialise.setData(
    data = sample_items_data,
    itemNameField = 'title',
    itemTagField = 'tags',
    )

Or else set data from file,

itemData = itemsInitialise.setData_file(
    filePath = 'path to the data file',
    itemName_col = 'column name carrying the item name/id',
    itemTag_col = 'column name carrying the item features',
    fileType = 'type of file (xlsx/csv)'
    )

Users Data

usersInitialise = prc.UsersData()

Configure Data

# Reffer from sample data given below:
sample_users_data = {"names":['Professor','Lisbon','Berlin','Nairobi','Helsinki','Rio'],
            "visited":[
                ['Place-B','Place-D'],
                ['Place-D','Place-E'],
                ['Place-B'],
                ['Place-C','Place-E'],
                ['Place-F'],
                ['Place-A', 'Place-F']
            ]
           }

usersData = usersInitialise.setData(
    data = sample_users_data,
    userNameField = 'names',
    triedItemField = 'visited',
    )

Recommeder based on Similar Items

This is used to find other items similar to the given item based on the features.

similarItemInit = prc.SimilarItem(itemData)
recommendation = similarItemInit.similarItem('Place-D')

Content-based Recommeder for specific users based on items tried

contentRecommendInit = prc.UserContent(itemData=itemData, usersData=usersData)
recommendation = contentRecommendInit.contentRecomend('Lisbon')
  • recommendation carries a list with each recommended items and their recommendation score on 100.
  • recommendation might have items with negative score which implies the item is already tried. This scenario occurs only if you have less number of items in 'ItemData'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_recommendation-0.1.5.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_recommendation-0.1.5-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file py_recommendation-0.1.5.tar.gz.

File metadata

  • Download URL: py_recommendation-0.1.5.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for py_recommendation-0.1.5.tar.gz
Algorithm Hash digest
SHA256 492bccf56165a8ec3027c7cde1b4e6f844cd8ef26d4425e2eb56fc82d00794c3
MD5 a475c7766603081b4610f75d6a4b038f
BLAKE2b-256 f62dc20183eab4fb4cc3b332f90dc9c1fdfe05ce64f0e8039d39ba9902ead79c

See more details on using hashes here.

File details

Details for the file py_recommendation-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: py_recommendation-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for py_recommendation-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 23da74eff3d9038a7fa175a67df1bb82e94b9d880d5f42774c0bf2b097ef0bfe
MD5 1ddb9005ff2f2cff7e7b73de6174d3a1
BLAKE2b-256 b7fc0d568f151e2b412dd33094c7436a419497edf5dc0ec7a6397780d42132e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page