Practical overview
When it fits
Use it when you need PyTorch-based CTR model implementations for a ranking or prediction workflow and want to train or adapt a model rather than build all components from scratch.
Who it is for
- Developers building CTR prediction models for ranking applications.
- Researchers and practitioners comparing deep-learning CTR architectures.
Documented uses
- Build a custom CTR prediction model from reusable components.
- Train a supported CTR model and use it to produce predictions.
- Compare model architectures for ad or recommendation ranking work.
Requirements & limits
The repository is public and lists an Apache-2.0 license. The README provides a pip installation command and links to a Quick Start guide.
- The library provides models and components, not a complete advertising or recommendation application.
- The README describes model fitting and prediction methods alongside custom model construction.
- The model catalog includes multiple architecture families, useful for comparison or prototyping.
- The documented installation pointer is a pip command; consult the linked project documentation for detailed environment setup.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and evaluate a DeepFM CTR model using the Quick Start workflow
Prepare the sample Criteo data, train a binary DeepFM model, and generate predictions for the held-out test split.
Before you start
- Python environment with PyTorch 1.2.0 or later.
- DeepCTR-Torch, pandas, scikit-learn, and the sample file
criteo_sample.txtavailable to the workflow.
Steps
Install DeepCTR-Torch with the command below.
pip install -U deepctr-torchLoad
criteo_sample.txt; fill missing sparse feature values with-1and dense values with0. Label-encode the sparse features and normalize the dense features withMinMaxScalerto the range 0–1.Create
SparseFeatandDenseFeatfeature columns, derive feature names, and split the data into training and test sets withtrain_test_split(test_size=0.2).Create a binary-task
DeepFMmodel, compile it with Adam and binary cross-entropy, then callfitwith batch size 256, 10 epochs, and a 0.2 validation split.Call
predicton the test inputs with batch size 256.
Expected outcome
A trained binary DeepFM model and predictions for the held-out test inputs.
Guide limitations
- The documented Quick Start uses label encoding; hash encoding and on-the-fly feature hashing are marked as currently unsupported.
- The sample workflow uses a fixed train/test split, batch size, epoch count, and validation split; it does not document production deployment or a guaranteed performance result.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- shenweichen/DeepCTR-Torch · Official homepage title · retained in its source language

