{"name":"TensorRec: A TensorFlow Recommendation Framework in Python","description":"TensorRec is a Python recommendation system built on TensorFlow, designed for quickly developing and customizing recommendation algorithms. It allows users to define custom representation and loss functions while handling data manipulation, scoring, and ranking. Although not under active development, it provides a solid foundation for understanding and implementing recommender systems.","github":"https://github.com/jfkirk/tensorrec","url":"https://osrepos.com/repo/jfkirk-tensorrec","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/jfkirk-tensorrec","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/jfkirk-tensorrec.md","json":"https://osrepos.com/repo/jfkirk-tensorrec.json","topics":["framework","machine-learning","python","recommendation-algorithm","recommendation-system","recommender-system","tensorflow","data-science"],"keywords":["framework","machine-learning","python","recommendation-algorithm","recommendation-system","recommender-system","tensorflow","data-science"],"stars":null,"summary":"TensorRec is a Python recommendation system built on TensorFlow, designed for quickly developing and customizing recommendation algorithms. It allows users to define custom representation and loss functions while handling data manipulation, scoring, and ranking. Although not under active development, it provides a solid foundation for understanding and implementing recommender systems.","content":"## Introduction\nTensorRec is a powerful Python recommendation system built on TensorFlow, allowing developers to quickly create and customize recommendation algorithms. It provides a flexible framework where you can define your own representation or embedding functions and loss functions, while TensorRec efficiently manages the underlying data manipulation, scoring, and ranking processes to generate recommendations.\n\nIt's important to note that TensorRec is not under active development. However, the maintainer is open to reviewing pull requests, making it a valuable resource for learning and exploring TensorFlow-based recommender systems. A TensorRec system processes three key data inputs: `user_features`, `item_features`, and `interactions`, using them to learn and produce ranked recommendations.\n\n## Installation\nGetting started with TensorRec is straightforward. You can install it using pip:\n\nbash\npip install tensorrec\n\n\n## Examples\nHere's a basic example demonstrating how to use TensorRec to build, fit, and evaluate a recommendation model:\n\npython\nimport numpy as np\nimport tensorrec\n\n# Build the model with default parameters\nmodel = tensorrec.TensorRec()\n\n# Generate some dummy data\ninteractions, user_features, item_features = tensorrec.util.generate_dummy_data(\n    num_users=100,\n    num_items=150,\n    interaction_density=.05\n)\n\n# Fit the model for 5 epochs\nmodel.fit(interactions, user_features, item_features, epochs=5, verbose=True)\n\n# Predict scores and ranks for all users and all items\npredictions = model.predict(user_features=user_features,\n                            item_features=item_features)\npredicted_ranks = model.predict_rank(user_features=user_features,\n                                     item_features=item_features)\n\n# Calculate and print the recall at 10\nr_at_k = tensorrec.eval.recall_at_k(predicted_ranks, interactions, k=10)\nprint(np.mean(r_at_k))\n\n\n## Why Use TensorRec?\nTensorRec offers a flexible approach to building recommendation systems, allowing deep customization of core components like representation and loss functions. It abstracts away much of the boilerplate, enabling developers to focus on the algorithm's logic and experimentation.\n\nWhile development is not active, its well-structured design and clear examples make it an excellent educational tool for understanding TensorFlow-based recommenders. For those seeking actively maintained alternatives, the project maintainer suggests exploring TensorFlow Ranking, Spotlight, or LightFM.\n\n## Links\n*   **GitHub Repository:** [jfkirk/tensorrec](https://github.com/jfkirk/tensorrec \"TensorRec GitHub Repository\")\n*   **Official Wiki:** [TensorRec Wiki](https://github.com/jfkirk/tensorrec/wiki \"TensorRec Wiki\")\n*   **Original Blog Post:** [A Recommendation Engine Framework in TensorFlow](https://medium.com/@jameskirk1/tensorrec-a-recommendation-engine-framework-in-tensorflow-d85e4f0874e8 \"Original Blog Post on Medium\")\n*   **Introduction to Recommender Systems Slides:** [Architecting Recommender Systems](https://www.slideshare.net/JamesKirk58/boston-ml-architecting-recommender-systems \"Slideshare Presentation\")\n*   **PyPI:** [tensorrec on PyPI](https://pypi.org/project/tensorrec/ \"TensorRec on PyPI\")","metrics":{"detailViews":7,"githubClicks":18},"dates":{"published":null,"modified":"2026-05-17T11:55:13.000Z"}}