Skip to main content

Deep-Learning based CTR models implemented by PyTorch

Project description

Build Status

PyPI version

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
DeepFM [IJCAI 2017]DeepFM: A Factorization-Machine based Neural Network for CTR Prediction
DIN [KDD 2018]Deep Interest Network for Click-Through Rate Prediction
DNN + GRU + GRU + Attention [AAAI 2019]Deep Interest Evolution Network for Click-Through Rate Prediction
DNN + GRU + AIGRU [AAAI 2019]Deep Interest Evolution Network for Click-Through Rate Prediction
DNN + GRU + AGRU [AAAI 2019]Deep Interest Evolution Network for Click-Through Rate Prediction
DNN + GRU + AUGRU [AAAI 2019]Deep Interest Evolution Network for Click-Through Rate Prediction
DIEN [AAAI 2019]Deep Interest Evolution Network for Click-Through Rate Prediction
OTHER TODO

example

movielens-1M

This dataset is just used to test the code can run, accuracy does not make sense.

amazon

accuracy

benchmark

acknowledge and reference

  • Referring the design from DeepCTR, the features are divided into dense (class Number), sparse (class Category), sequence (class Sequence) types.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prediction-flow-x-0.1.9.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

prediction_flow_x-0.1.9-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

Details for the file prediction-flow-x-0.1.9.tar.gz.

File metadata

  • Download URL: prediction-flow-x-0.1.9.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.4.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.5

File hashes

Hashes for prediction-flow-x-0.1.9.tar.gz
Algorithm Hash digest
SHA256 d69fc86929838c7dcbc7611c165d9e52cec786c315a35df7cb9a5500e412bc0a
MD5 c43b313eeff4ac9cee4de6f699b4c8a0
BLAKE2b-256 5a193ff30fbfa474bbfd5b0e708999bc5786516762236441e379d1435fc89b29

See more details on using hashes here.

File details

Details for the file prediction_flow_x-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: prediction_flow_x-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.4.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.5

File hashes

Hashes for prediction_flow_x-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2c7b437ffa84bac7dea2edbdd342622ea2a41bea18f46d4e6e0d9735a293da15
MD5 2f560166a7739c4bac1620d221a5d257
BLAKE2b-256 9fee9560e3533eda86d666f7237388f07eecfb502e79fd04210dbe6c2f5f1e94

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page