A configurable, tunable, and reproducible library for CTR prediction
Project description
FuxiCTR
Click-through rate (CTR) prediction is an critical task for many industrial applications such as online advertising, recommender systems, and sponsored search. FuxiCTR provides an open-source library for CTR prediction, with stunning features in configurability, tunability, and reproducibility.
Model List
Dependency
Requirements
pip install fuxictr
D
Get Started
1. Run the demo
Please follow the examples in the demo directory to get started. The code workflow is structured as follows:
# Set the data config and model config
feature_cols = [{...}] # define feature columns
label_col = {...} # define label column
params = {...} # set data params and model params
# Set the feature encoding specs
feature_encoder = FeatureEncoder(feature_cols, label_col, ...) # define the feature encoder
feature_encoder.fit(...) # fit and transfrom the data
# Load data generators
train_gen, valid_gen, test_gen = data_generator(feature_encoder, ...)
# Define a model
model = DeepFM(...)
# Train the model
model.fit_generator(train_gen, validation_data=valid_gen, ...)
# Evaluation
model.evaluate_generator(test_gen)
2. Run the benchmark with given experiment_ID
For reproducing the experiment result, you can run the benchmarking script with the corresponding config file as follows.
- --config: The config directory of data and model config files.
- --expid: The specific experiment_ID that records the detailed data and model settings.
- --gpu: The gpu index used for experiment, and -1 for CPU.
For example, DeepFM_test
is an expid located in config/model_config/tests.yaml
.
cd benchmarks
python run.py --config ../config --expid DeepFM_test --gpu 0
3. Tune the model hyper-parameters
For model hyper-parameters tuning, you can apply grid-search over the specified tuning space with the following script.
- --config: The config file that defines the tuning space
- --gpu: The available gpus for parameters tuning.
cd benchmarks
python run_param_tuner.py --config ./FM_criteo_x4_001/FM_criteo_x4_tuner_config_01.yaml --gpu 0
Code Structure
Check an overview of code structure for more details on API design.
License
The MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for fuxictr-1.0.0-py3.6-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce172a05cc888e66e5b8d9c6c405c6cd73ed6ee78a48b58af19e0877049e97c |
|
MD5 | 1f5757834cd981521da68e1082d036c5 |
|
BLAKE2b-256 | e81d1a9cb0bbf8fbf828d750ec7936253202aa08908487c7cab8dba94140eccf |