[![Build Status](https://travis-ci.org/GitHub-HongweiZhang/prediction-flow.svg?branch=master)](https://travis-ci.org/GitHub-HongweiZhang/prediction-flow)
[![PyPI version](https://badge.fury.io/py/prediction-flow.svg)](https://badge.fury.io/py/prediction-flow)
# prediction-flow
**prediction-flow** is a Python package providing modern **Deep-Learning**
based CTR models. Models are implemented by **PyTorch**.
## how to use
* Install using pip.
```
pip install prediction-flow
```
## feature
### how to define feature
There are two parameters for all feature types, name and column_flow.
The name parameter is used to index the column raw data from input data frame.
The column_flow parameter is a single transformer of a list of transformers.
The transformer is used to pre-process the column data before training the model.
* dense number feature
```
Number('age', StandardScaler())
Number('ctr', None)
```
* sparse category feature
```
Category('movieId', CategoryEncoder(min_cnt=1))
```
* var length sequence feature
```
Sequence('genres', SequenceEncoder(sep='|', min_cnt=1))
```
## transformer
The following transformers are provided now.
| transformer | supported feature type | detail |
|--|--|--|
| StandardScaler | Number | Wrapper of scikit-learn's StandardScaler. Null value must be filled in advance. |
| LogTransformer | Number | Log scaler. Null value must be filled in advance. |
| CategoryEncoder | Category | Converting str value to int. Null value must be filled in advance using '\_\_UNKNOWN\_\_'. |
| SequenceEncoder | Sequence | Converting sequence str value to int. Null value must be filled in advance using '\_\_UNKNOWN\_\_'. |
## model
| model | reference |
|--|--|
| DNN | - |
| Wide & Deep | [DLRS 2016][Wide & Deep Learning for Recommender Systems](https://arxiv.org/pdf/1606.07792.pdf) |
| DeepFM | [IJCAI 2017][DeepFM: A Factorization-Machine based Neural Network for CTR Prediction](http://www.ijcai.org/proceedings/2017/0239.pdf) |
| DIN | [KDD 2018][Deep Interest Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1706.06978.pdf) |
| DNN + GRU + GRU + Attention | [AAAI 2019][Deep Interest Evolution Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1809.03672.pdf) |
| DNN + GRU + AIGRU | [AAAI 2019][Deep Interest Evolution Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1809.03672.pdf) |
| DNN + GRU + AGRU | [AAAI 2019][Deep Interest Evolution Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1809.03672.pdf) |
| DNN + GRU + AUGRU | [AAAI 2019][Deep Interest Evolution Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1809.03672.pdf) |
| DIEN | [AAAI 2019][Deep Interest Evolution Network for Click-Through Rate Prediction](https://arxiv.org/pdf/1809.03672.pdf) |
| OTHER | TODO |
## example
### movielens-1M
**This dataset is just used to test the code can run, accuracy does not make
sense.**
* Prepare the dataset. [preprocess.ipynb](examples/movielens/ml-1m/preprocess.ipynb)
* Run the model. [movielens-1m.ipynb](examples/movielens/movielens-1m.ipynb)
### amazon
* Prepare the dataset. [prepare_neg.ipynb](examples/amazon/prepare_neg.ipynb)
* Run the model.
[amazon.ipynb](examples/amazon/amazon.ipynb)
* An example using [pytorch-lightning](https://github.com/williamFalcon/pytorch-lightning).
[amazon-lightning.ipynb](examples/amazon/amazon-lightning.ipynb)
**accuracy**
![benchmark](examples/amazon/simple_benchmark.png)
## acknowledge and reference
* Referring the design from [DeepCTR](https://github.com/shenweichen/DeepCTR),
the features are divided into dense (class Number), sparse (class Category),
sequence (class Sequence) types.
没有合适的资源?快使用搜索试试~ 我知道了~
流量预测(DNN、DNN + GRU + GRU + Attention、DNN + GRU + AIGRU)
共80个文件
py:61个
ipynb:5个
md:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 2 下载量 123 浏览量
2023-02-01
10:29:00
上传
评论 2
收藏 519KB ZIP 举报
温馨提示
流量预测(DNN、DNN + GRU + GRU + Attention、DNN + GRU + AIGRU)prediction-flow 是一个 Python 包,提供基于现代深度学习的 CTR 模型。 模型由 PyTorch 实现。(Python完整源码和数据)
资源推荐
资源详情
资源评论
收起资源包目录
prediction-flow-master.zip (80个子文件)
prediction-flow-master
prediction_flow
__init__.py 22B
features
__init__.py 221B
features.py 2KB
category_feature.py 2KB
tests
__init__.py 0B
test_features.py 3KB
sequence_feature.py 2KB
number_feature.py 590B
base.py 1KB
metrics
__init__.py 0B
utils
__init__.py 0B
transformers
__init__.py 0B
column
__init__.py 378B
log_transformer.py 986B
tests
__init__.py 0B
test_log_transformer.py 326B
test_column_flow.py 744B
test_sequence_encoder.py 826B
test_category_encoder.py 952B
test_standard_scaler.py 399B
column_flow.py 2KB
category_encoder.py 2KB
standard_scaler.py 1KB
sequence_encoder.py 4KB
base.py 2KB
pytorch
dnn.py 3KB
utils.py 980B
__init__.py 266B
nn
__init__.py 403B
interest.py 9KB
tests
__init__.py 0B
test_pooling.py 787B
test_interest.py 4KB
test_attention.py 2KB
test_mlp.py 564B
test_rnn.py 2KB
test_fm.py 421B
rnn.py 5KB
fm.py 567B
pooling.py 887B
mlp.py 2KB
attention.py 2KB
wide_deep.py 6KB
data
__init__.py 59B
tests
__init__.py 0B
test_dataset.py 3KB
dataset.py 2KB
tests
utils.py 2KB
__init__.py 0B
test_wide_deep.py 5KB
test_dien.py 6KB
test_deepfm.py 4KB
test_din.py 2KB
test_dnn.py 6KB
dien.py 4KB
interest_net.py 8KB
functions.py 6KB
din.py 1KB
base.py 2KB
deepfm.py 5KB
.travis.yml 56B
setup.py 2KB
.github
ISSUE_TEMPLATE
feature_request.md 621B
bug_report.md 553B
LICENSE 1KB
examples
amazon
prepare_neg.ipynb 14KB
simple_benchmark.png 13KB
amazon-lightning.ipynb 24KB
amazon.ipynb 66KB
movielens
ml-1m
README 5KB
preprocess.ipynb 40KB
train.csv 828KB
test.csv 207KB
movielens-1m.ipynb 88KB
MANIFEST.in 131B
.gitignore 1KB
setup.cfg 39B
CONTRIBUTING.md 5B
requirements.txt 76B
README.md 4KB
共 80 条
- 1
资源评论
- wanvzheguilai1232024-01-25资源有很好的参考价值,总算找到了自己需要的资源啦。
- 2301_773215762023-08-18资源很实用,对我启发很大,有很好的参考价值,内容详细。
前程算法屋
- 粉丝: 4220
- 资源: 712
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于pytorch+Unet进行MRI肝脏图像分割源码+数据集+模型.zip
- 在Android Studio中开发一个Android App项目步骤
- 基于yolov8实现进行物体跟踪源码.zip
- Java多线程学习Java多线程学习Java多线程学习Java多线程学习.txt
- 算法数据结构-动态规划算法(Dynamic Programming)超详细总结加应用案例讲解.txt
- 2024最强秋招八股文(精简、纯手打)2024最强秋招八股文(精简、纯手打).txt
- 基于tensorflow多特征融合的微表情识别python源码.zip
- 基于yolov8实现人脸检测的python源码+运行说明.zip
- Micron Memory DDR3 SDRAM 全系列AD集成库(原理图库+PCB封装库).IntLib
- 基于tensorflow多特征融合的微表情识别python源码+详细使用说明.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功