Skip to main content

funrec

funrec 是基于 PyTorch 的深度学习推荐模型与特征工程工具集,提供 CTR 模型、特征列和常用网络层。

安装

pip install funrec

使用

最小示例:

import torch
from funrec.inputs import DenseFeat, SparseFeat, build_input_features
from funrec.models import DeepFM

columns = [SparseFeat("user", 4, embedding_dim=4), DenseFeat("score")]
model = DeepFM(columns, columns, dnn_hidden_units=(8, 4))
features = build_input_features(columns)
x = torch.zeros(2, len(features))
print(model(x).shape)  # torch.Size([2, 1])

更多训练示例见 examples/,运行前需额外安装 pip install funrec[examples](含 pandas), 各脚本按自身文件路径解析同目录下的数据文件,直接执行 python examples/<脚本名>.py 即可, 无需切换工作目录。MIND 模型的训练与召回评估(funrec.models.p2019.mind.train)还需要 faiss/matplotlib,安装 pip install funrec[mind]。

感恩的心

  • DeepCTR 易用可扩展的深度学习点击率预测算法包。
    • DeepCTR:上游项目采用 MIT License。
    • DeepCTR-Torch:上游项目采用 MIT License,本项目部分代码来源于此。
  • fun-rec 推荐系统的整体介绍,包含 推荐系统概述、推荐算法基础、推荐系统实战和推荐系统面经

关于 farfarfun

farfarfun 是一个专注于实用工具库的开源组织, 涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。

本项目基于 MIT 协议开源。

Metadata

Release files for funrec 1.0.10

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

Built distribution (wheel)

Table of built distributions (wheels) for funrec 1.0.10
File Interpreter ABI Platform
funrec-1.0.10-py3-none-any.whl Python 3 none any Details

Release files / funrec-1.0.10-py3-none-any.whl

Download URL funrec-1.0.10-py3-none-any.whl
Size 115.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b80bed085ac4ed23b76bc67aac3854d427e9ee6fb1f9caaa4e8415a73f8998fc
BLAKE2b-256 checksum
How to use checksums
2b489b2d16d4c94e13b20603ea70e4d941d9bfb1e9cccf807ea0733e697bdb5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.10 This release

1 release file

0.0.7

1 release file

0.0.6

2 release files

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

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