Registry / ai-ml / recbole

recbole

JSON →
library1.2.1pypypiunverified

RecBole is a unified, comprehensive, and efficient Python library for recommendation systems, built on PyTorch. It provides a wide array of state-of-the-art recommendation models and datasets, featuring standardized data processing, training, and evaluation pipelines. The library undergoes active development, with major updates and new versions typically released every few months, incorporating user feedback and architectural improvements.

pip install recbole
INSTALL
IMPORT
SIG · RECBOLE
R
recbole
ai-mlpythonv1.2.1
Install
87.1s avg
Import
Disk
5376MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 100.23s
py 3.11
✕ build_error
✓ 92.53s
py 3.12
✕ build_error
✓ 81.73s
py 3.13
✕ build_error
✓ 73.88s
py 3.9
✕ build_error
✕ timeout
5376MB installed
● package 5376MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

run_recbole
from recbole.quick_start import run_recbole
from recbole.quick_start import run_recbole

This quickstart demonstrates how to run a basic BPR recommendation model on the `ml-100k` dataset using `run_recbole`. RecBole will automatically download and preprocess the dataset if not found. The configuration dictionary allows for inline specification of model, dataset, and evaluation parameters without needing a separate YAML file.

import os import torch from recbole.quick_start import run_recbole # Ensure you have a 'dataset' folder in the current directory # and 'ml-100k' dataset downloaded/prepared, or RecBole will download it. # Basic configuration for running a BPR model on ml-100k dataset # Using CPU by default, or GPU if available and recbole[gpu] was installed. config_dict = { 'model': 'BPR', 'dataset': 'ml-100k', 'eval_args': { 'split_ratio': '0.8:0.1:0.1', # Train:Valid:Test split 'group_by': 'user' # Ensure evaluation is fair per user }, 'use_gpu': torch.cuda.is_available() # Dynamically check for GPU } print(f"Running RecBole with config: {config_dict}") # Run the recommendation experiment run_recbole(config_dict=config_dict)
Debug
Known issues
breakingMajor architectural overhauls in versions like v1.0.0, v1.1.0, and v1.2.0 introduced significant changes to the framework, especially affecting the data module and configuration API.
fix
Review the official documentation for the specific version you are upgrading to. Pay close attention to changes in data loading, dataset preparation (e.g., `create_dataset`), and how configuration objects (`Config`) are initialized and passed.
affects: >=1.0.0
gotchaRecBole often requires specific versions of PyTorch. Installing `recbole[gpu]` ensures GPU dependencies are pulled, but manual CUDA setup and matching PyTorch-CUDA versions are critical.
fix
For GPU usage, ensure your system has a compatible CUDA toolkit installed. Then, use `pip install recbole[gpu]` or `pip install recbole torch==X.Y.Z+cuXXX` where `X.Y.Z` and `cuXXX` match your CUDA version and desired PyTorch build. Always check the official PyTorch installation guide for the correct command.
affects: All
gotchaConfiguring datasets and data preprocessing can be complex. Incorrect paths, invalid split ratios, or missing necessary dataset files (like `.inter`, `.item`, `.user` files) are common sources of errors.
fix
Ensure your dataset files are correctly placed in the `dataset` directory (e.g., `dataset/ml-100k/ml-100k.inter`). For custom datasets, carefully follow the data format specification in the RecBole documentation. Use `config['data_path']` if your dataset is not in the default location.
affects: All
Upgrade
Version history
1.2.1latest on PyPI · released Feb 24, 2025
Audit
Dependencies
torchoptionalRecBole is built on PyTorch for deep learning models. Specific versions (>=1.7.0) are required.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources