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.
- Prepare the dataset. preprocess.ipynb
- Run the model. movielens-1m.ipynb
amazon
- Prepare the dataset. prepare_neg.ipynb
- Run the model. amazon.ipynb
- An example using pytorch-lightning. amazon-lightning.ipynb
accuracy
acknowledge and reference
- Referring the design from DeepCTR, the features are divided into dense (class Number), sparse (class Category), sequence (class Sequence) types.
Metadata
Release files for prediction-flow 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| prediction-flow-0.1.5.tar.gz | 25.8 kB | Without provenance | Details |
Release files / prediction-flow-0.1.5.tar.gz
| Download URL | prediction-flow-0.1.5.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6304ea6238690672368e0315203c98eda3b3e4de9881c5ada1c267cd74f77cca
|
|
BLAKE2b-256 checksum How to use checksums |
565784002451f71c5ced1c442cee14145c3fdfa3479a142a6c31d2c1ec0f9fe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.57.0 CPython/3.6.8
|
Security for prediction-flow 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.