Skip to main content

Easy Recommender

English | 日本語

⚠️ This package is currently broken and under repair. Please do not use. ⚠️

This project only works with Python 3.11.11 because LightFM requires this specific version. Other versions are not supported.

A simple and efficient recommendation system library using LightFM.

Features

  • Simple API for building recommendation systems
  • Support for both implicit and explicit feedback
  • Built on top of proven library (LightFM)
  • Easy data preprocessing utilities

Installation

pip install easy-recommender

Quick Start

from easy_recommender import recommend, process_df, build_feature_data
import pandas as pd

# Load your data
df = pd.read_csv('your_ratings.csv')

user_features = ['gender', 'age']
item_features = ['price', 'genre']

# Get recommendations
recommendations = recommend(
    processed_df, 
    user_features, 
    item_features,
)

print(recommendations)

Higher values indicate items that are more recommended.

If you want to recommend users for items instead, please swap the user and item columns.

Data Requirements

This library takes user behavior log CSV as an argument. Behavior logs are records of users purchasing/viewing/liking item A.

Specifically, to use this library, you need CSV data in the following format:

  • CSV with headers: Must include column names
  • Required columns: user_id and item_id must be present
  • Feature columns:
    • User-related column names should be specified as user_features (list of strings)
    • Item-related column names should be specified as item_features (list of strings)
    • If you have columns that don't belong to either users or items, include them in user_features
  • Data quality: Columns with many null or undefined values may affect recommendation accuracy. Please remove such columns in advance.

Data Example

For example, the following data format is expected. Note that case sensitivity matters. Also, there is no automatic conversion between numeric and string types. If you write rankings as "1", it's treated as a string. If categories are handled as numbers like 2,3, they are treated as numeric values, which may reduce recommendation accuracy.

user_id,item_id,gender,age,price,genre
1,101,M,25,1200,Action
1,102,M,25,800,Comedy
2,101,F,30,1200,Action

Requirements

  • Python =3.11.11

License

MIT License

References

This implementation is based on the approach described in: https://zenn.dev/genda_jp/articles/2c2a1b5d185741

Metadata

Release files for easy-recommender 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy-recommender 0.1.3
File Size Uploaded
easy_recommender-0.1.3.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for easy-recommender 0.1.3
File Interpreter ABI Platform
easy_recommender-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / easy_recommender-0.1.3.tar.gz

Download URL easy_recommender-0.1.3.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
62ad74c1683ad58be787e4f8832796ad3036fce202fdddb3b5ad513df20affc2
BLAKE2b-256 checksum
How to use checksums
53d9c4998987511120e8fef87456656e5462033bcddfc3ea28a2097b11e803c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / easy_recommender-0.1.3-py3-none-any.whl

Download URL easy_recommender-0.1.3-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2129d3856f1331c85194913feb99e64e05e725d7f8f1cc3fecf8810a5672a9d8
BLAKE2b-256 checksum
How to use checksums
0c2f91b856873f46171bb84900818923109b66c65a7dde0b7e10508e4f84766a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page