liveBook · Manning

Language model

As explained in Kafka for Architects

Inference is the generation of model predictions from input data using a trained machine-learning model.

A machine-learning model learns patterns from training data and uses them to predict values for new, unseen inputs. In live inference, it generates a prediction from a fresh event. section 12.4.1 section 12.4

Training can happen ahead of deployment: a model server hosts the trained model, while an application extracts event data, requests a prediction, and receives the result. Kafka can carry events into this flow and prediction results onward. section 12.4.1 section 12.4

A typical prediction flow separates model preparation from serving:

  • Prepare data, define features and a target, then split the data for training and testing. section 12.4.1
  • Train and evaluate the model, then deploy it to respond to new event data. section 12.4.1

Live prediction

An event can provide input for a fraud-detection prediction; the need for timely decisions makes streaming inference useful. section 12.4

Figure 12.6 The ML model is deployed in advance and is used by the Kafka Streams application for predictions.
A diagram of a model

AI-generated content may be incorrect.

Shows a previously deployed model being used by a Kafka Streams application to make predictions. section 12.4.1

How Kafka for Architects covers it

How deep it goes
Explains data preparation, train/test evaluation, and serving predictions, but stops short of algorithm internals.
Examples
Uses ad-click prediction and fraud detection to illustrate model targets and real-time inference.
What it assumes
Builds from zero through data cleaning, feature and target selection, and training and test splits.
What you can do after
Apply it via a deployed model server to produce predictions from incoming event data.
How it connects
Connects machine-learning models with Kafka, model servers, and incremental learning.

Also explained in

Compare how 67 books explain language model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.