Model or dataset
shenweichen/DeepCTR avatar
shenweichen/DeepCTR

DeepCTR: A Model Zoo for Click-Through-Rate Prediction on TensorFlow

Easy-to-use,Modular and Extendible package of deep-learning based CTR models .

8,053 stars2,217 forksPythonApache-2.0

At a glance

What is it?
DeepCTR packages roughly twenty published CTR architectures behind a tf.keras-style fit/predict interface, with an Estimator path for large data. It is a research and prototyping library, and the TensorFlow version you install is your problem, not its dependency resolver's.
Who is it for?
Adopt DeepCTR if you are reproducing a CTR paper, teaching feature-interaction architectures, or need a working baseline before committing to a bespoke model, and you are willing to pin TensorFlow yourself. Do not adopt it if you need a serving stack, feature pipelines, or a framework that owns its dependency graph.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 75 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem DeepCTR addresses: reimplementing the same CTR papers

Click-through-rate prediction has produced a long line of published architectures, and most of them differ in one component: how feature interactions are modelled. DeepFM, xDeepFM, AutoInt, Deep & Cross Network and the rest share the same input shape (sparse multi-field categorical features) and the same output (a probability), but each paper proposes a different block in the middle. Reimplementing that block, plus the embedding layer, plus the training loop, is the repetitive part of CTR research. DeepCTR's stated goal is to remove it. The README describes the package as a collection of deep-learning based CTR models together with core component layers, so that you can build custom models from the same parts. The audience is therefore narrow and specific: engineers and researchers who already have a labelled impression log in a tabular, multi-field format and want to compare architectures on it. If your problem is ranking a small catalogue or serving embeddings at low latency, this is not the layer you are missing.

What the model list actually contains

The README's Models List is the substance of the project. It maps each implemented architecture to its paper, and the range is wide: Factorization-supported Neural Network (ECIR 2016), Product-based Neural Network (ICDM 2016), Wide & Deep (DLRS 2016), DeepFM (IJCAI 2017), Piece-wise Linear Model (arXiv 2017), Deep & Cross Network (ADKDD 2017), Attentional Factorization Machine (IJCAI 2017), Neural Factorization Machine (SIGIR 2017), xDeepFM (KDD 2018), Deep Interest Network (KDD 2018), AutoInt (CIKM 2019), Deep Interest Evolution Network (AAAI 2019) and FwFM (WWW 2018), among others. Two families are visible in that list. The first covers feature-interaction models, where the input is a fixed set of fields and the model learns cross terms. The second covers sequence models: DIN and DIEN consume a user's behaviour history rather than a static feature vector. That distinction matters when you plan your data pipeline, because a DIN or DIEN input is not the same shape as a DeepFM input. The repository topics also name MLR, NFM, FGCNN, MMOE, PLE and ESMM, which the truncated README does not reach in its table. Treat the topic list as a hint, not a guarantee, and verify each model against the README or the documentation site before designing around it.

Two interfaces: Keras-style models and TensorFlow Estimators

The README states that DeepCTR provides tf.keras.Model-like interfaces for quick experiment, and that you can use any complex model with model.fit() and model.predict(). That is the prototyping path: instantiate a model class, call fit on arrays or a tf.data pipeline, call predict. The second path is a tensorflow estimator interface, which the README ties to large scale data and distributed training, and the documentation link for it mentions TFRecord input. The two interfaces are not interchangeable in operation. Estimators expect an input_fn that produces features and labels, and they own checkpointing, evaluation and distribution strategy in a way the Keras path does not. Choosing between them is an early decision, because moving a working Keras experiment onto the Estimator path means rewriting the input pipeline, not just the model construction. The README also frames the package as extendible, pointing at core component layers for building custom models. That is the third usage pattern: take the layers, skip the prebuilt architectures, and assemble your own. It is the most durable of the three, since it depends least on the specific model classes staying in sync with TensorFlow.

Getting it running, and the TensorFlow constraint you inherit

The installation section is unusually direct. DeepCTR does not pin or install TensorFlow for you. The README's commands are two separate steps: pip install tensorflow, then pip install deepctr. You choose the TensorFlow build that matches your Python, NumPy, CPU or GPU, and operating system. The README states compatibility with both tf 1.15 and tf 2.x. It also notes that for Python >=3.9, DeepCTR allows modern h5py releases with h5py>=3.7.0, and that if TensorFlow reports a NumPy conflict you should follow the TensorFlow requirement for your chosen release, giving numpy<2 as an example when TensorFlow requires it. There is one further instruction worth taking literally: use public tensorflow.keras APIs in your own code, and avoid mixing tensorflow.python.keras with tensorflow.keras, because tensorflow.python.* is private TensorFlow API and can break model serialization or optimizer and metric loading across TensorFlow versions. That is a real failure mode, not a style preference. If you have existing code that imports from tensorflow.python.keras, fix it before you blame the library for a deserialization error.

The cost of a library that does not own its dependency

Because DeepCTR leaves TensorFlow unpinned, the compatibility surface is yours to manage. TensorFlow's own release cadence is the clock you are on, and the README's warning about private API imports is a symptom of that arrangement: DeepCTR tracks the public Keras surface, and anything reaching below it is at risk across versions. The release history in the supplied material shows a long gap between v0.9.3 in November 2022 and v0.9.4 in April 2026, which tells you that fixes to version drift may arrive slowly. Plan accordingly: pin both tensorflow and deepctr in a lockfile, and treat a TensorFlow upgrade as a change that requires re-running your training and serialization checks, not a routine bump. On licensing, the project is Apache-2.0, which permits commercial use and modification and includes a patent grant, but it also carries notice and attribution obligations for redistributed code. That is a general property of the licence, not legal advice; check your own distribution model against the licence text. The models themselves come from published papers, so if you ship a specific architecture, the paper and any associated code licence are a separate question from DeepCTR's.

Where DeepCTR is the wrong tool

DeepCTR stops at the model. It does not provide a feature store, a streaming pipeline, an online serving layer, or a monitoring system, and nothing in the README suggests otherwise. If your actual problem is that features arrive inconsistently between training and serving, adopting a model zoo does not address it. There is also a scale boundary. The Keras-style path loads data through fit and predict, which is convenient for experiments and awkward for datasets that do not fit comfortably in memory; the README directs large-scale and distributed work to the Estimator interface instead. And the Estimator API itself has been de-emphasised in TensorFlow 2.x, so committing to that path means committing to an interface whose long-term support is outside DeepCTR's control. Finally, if you need a model that is not in the list, DeepCTR gives you layers rather than the model, and you are back to implementing the paper. That is a reasonable outcome, but it is not the outcome the package name promises.

DeepCTR-Torch and DeepMatch as the alternatives

The README names two sibling projects, and they differ from DeepCTR in ways that matter. DeepCTR-Torch is the same family of CTR models implemented on PyTorch rather than TensorFlow. The practical difference is the framework contract: with DeepCTR-Torch you inherit PyTorch's dependency and release model, and you write training loops in PyTorch idiom instead of calling fit and predict on a Keras-like object. If your team already runs PyTorch for other models, the cost of the TensorFlow install and the version-drift problem described above disappears, at the price of leaving the tf.keras-style interface behind. DeepMatch is the other direction: its name and the README's grouping place it with matching and retrieval rather than CTR ranking. If your task is candidate generation from a large corpus, a CTR model is the wrong stage of the funnel regardless of which framework implements it. The honest comparison is therefore not DeepCTR versus one competitor but a question about your stack: which framework your team already operates, and whether your task is ranking or retrieval.

Who should adopt it, and what to verify first

DeepCTR fits teams that need a working CTR baseline quickly, that want to compare several published architectures on one dataset without writing each from scratch, or that are teaching how feature-interaction blocks differ. It fits less well when the model is the easy part of your system, which in production it usually is. The verification steps are concrete. First, open the README's Models List and confirm the architecture you intend to use is listed; the truncated table and the repository topics do not fully agree, so check the documentation site for the model you need. Second, resolve your TensorFlow version before installing anything, since the README states DeepCTR will not do it for you, and confirm your NumPy and h5py versions satisfy that TensorFlow release. Third, audit your own code for tensorflow.python.keras imports and replace them with tensorflow.keras, because the README identifies that mix as a cause of broken serialization and optimizer loading. Fourth, decide between the Keras-style and Estimator interfaces before writing the pipeline, since the input formats differ. Do those four things and DeepCTR is a low-risk dependency; skip them and the first error you hit will look like a library bug when it is a version mismatch.

Editorial conclusion

Adopt DeepCTR if you are reproducing a CTR paper, teaching feature-interaction architectures, or need a working baseline before committing to a bespoke model, and you are willing to pin TensorFlow yourself. Do not adopt it if you need a serving stack, feature pipelines, or a framework that owns its dependency graph. Before writing code, check the Models List in the README to confirm your target architecture is actually implemented, and read the installation section, which states plainly that DeepCTR does not pin or install TensorFlow for you.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. shenweichen/DeepCTR on GitHub
Community notes

Community notes