Skip to main content

Keras Recommenders

Keras Recommenders is a library for building recommender system models using Keras.

It was developed with a focus on enabling fast experimentation on recommender system.

It's built on Keras and aims to have a gentle learning curve in recommender models.

Note: Currently, Keras-recommenders is only support multi task learning framework, more models is preparing!

Welcome to join us!

Installation

Make sure you have TensorFlow 2.x and DeepCTR installed, and install from pip:

pip install keras-recommenders

Quick Start

from keras_recommenders.ple import PLE 

model = PLE(dnn_feature_columns, num_tasks=2, task_types=['binary', 'regression'], 
            task_names=['task 1','task 2'], num_levels=2, num_experts_specific=8,
            num_experts_shared=4, expert_dnn_units=[64,64], gate_dnn_units=[16,16],
            tower_dnn_units_lists=[[32,32],[32,32]])

model.compile("adam", loss=["binary_crossentropy", "mean_squared_error"], metrics=['AUC','mae'])

model.fit(X_train, [y_task1, y_task2], batch_size=256, epochs=5, verbose=2)

y_pred = model.predict(X_test, batch_size=256)

Multi-task Learning Models for Recommender Systems

Currently this project is developed based on DeepCTR :https://github.com/shenweichen/DeepCTR.

You can easy to use the code to design your multi task learning model for multi regression or classification tasks.

Example 1

Dataset: http://archive.ics.uci.edu/ml/machine-learning-databases/adult/

Task 1: (Classification) aims to predict whether the income exceeds 50K.

Task 2: (Classification) aims to predict this person’s marital status is never married.

Example 2

Dataset: https://archive.ics.uci.edu/ml/machine-learning-databases/census-income-mld/

Preparing

Model Description Paper
Shared-Bottom shared-bottom Multitask learning(1998)
ESMM Entire Space Multi-Task Model Entire Space Multi-Task Model: An Effective Approach for Estimating Post-Click Conversion Rate(SIGIR'18)
MMoE Multi-gate Mixture-of-Experts Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts(KDD'18)
CGC Customized Gate Control Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations(RecSys '20)
PLE Progressive Layered Extraction Progressive Layered Extraction (PLE): A Novel Multi-Task Learning (MTL) Model for Personalized Recommendations(RecSys '20)

Shared-Bottom & MMOE

mmoe&shared_bottom

ESMM

esmm1

CGC

cgc

PLE

ple

Metadata

Release files for keras-recommenders 0.0.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 keras-recommenders 0.0.3
File Size Uploaded Provenance Actions
keras-recommenders-0.0.3.tar.gz 11.7 kB Without provenance Details for keras-recommenders-0.0.3.tar.gz

Release files / keras-recommenders-0.0.3.tar.gz

Download URL keras-recommenders-0.0.3.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
407e8288d1a0d52153bce5efb48bb95744e1667d16382305d9cb372e12264cf1
BLAKE2b-256 checksum
How to use checksums
11f0d61c7c2aef13eb16af45640970e11cef422730a8cd0826658eeb7a3b26e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

Security for keras-recommenders 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file No provenance

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