tensorflow-recommenders

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

https://github.com/tensorflow/recommenders

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 43 committers (2.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.1%) to scientific vocabulary

Keywords

recommender recommender-system tensorflow tensorflow-recommenders

Keywords from Contributors

jax
Last synced: 6 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: tensorflow
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.87 MB
Statistics
  • Stars: 1,973
  • Watchers: 49
  • Forks: 293
  • Open Issues: 279
  • Releases: 16
Topics
recommender recommender-system tensorflow tensorflow-recommenders
Created over 5 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

TensorFlow Recommenders

TensorFlow Recommenders logo

TensorFlow Recommenders build badge PyPI badge

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

It helps with the full workflow of building a recommender system: data preparation, model formulation, training, evaluation, and deployment.

It's built on Keras and aims to have a gentle learning curve while still giving you the flexibility to build complex models.

Installation

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

shell pip install tensorflow-recommenders

Documentation

Have a look at our tutorials and API reference.

Quick start

Building a factorization model for the Movielens 100K dataset is very simple (Colab):

```python from typing import Dict, Text

import tensorflow as tf import tensorflowdatasets as tfds import tensorflowrecommenders as tfrs

Ratings data.

ratings = tfds.load('movielens/100k-ratings', split="train")

Features of all the available movies.

movies = tfds.load('movielens/100k-movies', split="train")

Select the basic features.

ratings = ratings.map(lambda x: { "movieid": tf.strings.tonumber(x["movieid"]), "userid": tf.strings.tonumber(x["userid"]) }) movies = movies.map(lambda x: tf.strings.tonumber(x["movieid"]))

Build a model.

class Model(tfrs.Model):

def init(self): super().init()

# Set up user representation.
self.user_model = tf.keras.layers.Embedding(
    input_dim=2000, output_dim=64)
# Set up movie representation.
self.item_model = tf.keras.layers.Embedding(
    input_dim=2000, output_dim=64)
# Set up a retrieval task and evaluation metrics over the
# entire dataset of candidates.
self.task = tfrs.tasks.Retrieval(
    metrics=tfrs.metrics.FactorizedTopK(
        candidates=movies.batch(128).map(self.item_model)
    )
)

def compute_loss(self, features: Dict[Text, tf.Tensor], training=False) -> tf.Tensor:

user_embeddings = self.user_model(features["user_id"])
movie_embeddings = self.item_model(features["movie_id"])

return self.task(user_embeddings, movie_embeddings)

model = Model() model.compile(optimizer=tf.keras.optimizers.Adagrad(0.5))

Randomly shuffle data and split between train and test.

tf.random.setseed(42) shuffled = ratings.shuffle(100000, seed=42, reshuffleeachiteration=False)

train = shuffled.take(80000) test = shuffled.skip(80000).take(20_000)

Train.

model.fit(train.batch(4096), epochs=5)

Evaluate.

model.evaluate(test.batch(4096), return_dict=True) ```

Owner

  • Name: tensorflow
  • Login: tensorflow
  • Kind: organization
  • Email: github-admin@tensorflow.org

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Kula"
  given-names: "Maciej"
- family-names: "Chen"
  given-names: "James"
- family-names: "Yi"
  given-names: "Xinyang"
- family-names: "Yao"
  given-names: "Tiansheng"
- family-names: "Sathiamoorthy"
  given-names: "Maheswaran"
- family-names: "Hong"
  given-names: "Lichan"
- family-names: "Chi"
  given-names: "Ed"
title: "TensorFlow Recommenders"
date-released: 2020-09-16
url: "https://github.com/tensorflow/recommenders"

GitHub Events

Total
  • Issues event: 11
  • Watch event: 137
  • Delete event: 6
  • Issue comment event: 35
  • Push event: 13
  • Pull request event: 13
  • Fork event: 19
  • Create event: 6
Last Year
  • Issues event: 11
  • Watch event: 137
  • Delete event: 6
  • Issue comment event: 35
  • Push event: 13
  • Pull request event: 13
  • Fork event: 19
  • Create event: 6

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 329
  • Total Committers: 43
  • Avg Commits per committer: 7.651
  • Development Distribution Score (DDS): 0.608
Past Year
  • Commits: 8
  • Committers: 2
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.25
Top Committers
Name Email Commits
Maciej Kula m****a@g****m 129
TonyWZ z****n@g****m 44
TensorFlow Recommenders Authors t****s@g****m 40
Albert Villanova del Moral 8****a 12
Wei Wei w****e@g****m 12
TensorFlow Recommenders Team t****m@g****m 11
Ziyin Huang z****h@g****m 9
pshiko p****w@g****m 6
Lichan Hong l****n@g****m 6
Chen Qian c****y@g****m 5
Tiansheng Yao t****o@g****m 4
Mark Daoust m****t@g****m 4
Jiaxi Tang j****t@g****m 3
Tayo Oguntebi t****o@g****m 3
Tim Schmeier t****s@s****m 3
TimSchmeier T****r 2
Maciej Kula m****a 2
Bruce Fontaine b****n@g****m 2
Hongyi Wen h****7@c****u 2
Kanchi Shimono d****o@g****m 2
Mahesh Sathiamoorthy n****n@g****m 2
Xinyang Yi x****g@g****m 2
Yash Katariya y****a@g****m 2
Zhaoyue Cheng z****c@g****m 2
hojinYang h****7@g****m 2
Anima Singh a****h@g****m 1
Danila Sinopalnikov s****v@g****m 1
Jan Cervenka j****a@y****m 1
hyphmongo 3****o 1
Samuel Marks 8****s 1
and 13 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 151
  • Total pull requests: 57
  • Average time to close issues: 25 days
  • Average time to close pull requests: 25 days
  • Total issue authors: 103
  • Total pull request authors: 16
  • Average comments per issue: 3.64
  • Average comments per pull request: 1.05
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 38
Past Year
  • Issues: 12
  • Pull requests: 10
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 12
  • Pull request authors: 4
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.9
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • ericy51 (6)
  • OmarMAmin (5)
  • abdollahpouri (5)
  • flynhigher (4)
  • zhifeng-huang (4)
  • ydennisy (4)
  • datasciyj (3)
  • riyaj8888 (3)
  • BrianMiner (3)
  • EdwardALockhart (3)
  • nialloh23 (3)
  • hkristof03 (3)
  • mustfkeskin (2)
  • houghtonweihu (2)
  • malinphy (2)
Pull Request Authors
  • copybara-service[bot] (44)
  • flynhigher (6)
  • keivanipchihagh (2)
  • getumen (2)
  • ZhaoyueCheng (2)
  • aniruthraj (2)
  • marygiotandoi (1)
  • vidhant (1)
  • shanemhansen (1)
  • rageSpin (1)
  • Nik-code (1)
  • gaikwadrahul8 (1)
  • AmgadHasan (1)
  • tiruk007 (1)
  • patrickorlando (1)
Top Labels
Issue Labels
question (15) bug (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 286,540 last-month
  • Total docker downloads: 10
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 32
    (may contain duplicates)
  • Total versions: 32
  • Total maintainers: 2
pypi.org: tensorflow-recommenders

Tensorflow Recommenders, a TensorFlow library for recommender systems.

  • Versions: 15
  • Dependent Packages: 1
  • Dependent Repositories: 32
  • Downloads: 286,540 Last month
  • Docker Downloads: 10
Rankings
Downloads: 0.6%
Stargazers count: 1.7%
Dependent repos count: 2.6%
Average: 2.8%
Forks count: 3.3%
Docker downloads count: 3.8%
Dependent packages count: 4.8%
Last synced: 6 months ago
proxy.golang.org: github.com/tensorflow/recommenders
  • Versions: 17
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 7.0%
Last synced: 6 months ago

Dependencies

.github/workflows/pylint-presubmit.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • trilom/file-changes-action v1.2.4 composite
.github/workflows/test.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
requirements.txt pypi
  • absl-py >=0.1.6
  • tensorflow >=2.9.0
  • tensorflow-macos >=2.9.0
tensorflow_recommenders/dev_requirements.txt pypi
  • fire * development