Online learning, also called incremental learning, updates a model as new data arrives rather than relying only on a static dataset and scheduled retraining. It fits decisions that must respond quickly to changing patterns, such as fraud detection, personalization, and operational monitoring. section 12.4.1 section 12.4
In a Kafka-based design, a consumer reads events from a topic in small batches and feeds them to the model. The model updates its parameters after each batch. This differs from using Kafka only to collect data for later batch training—or to supply events to an already deployed model for predictions. section 12.4.1
Flink ML offers another route: its unified API supports training on historical data and learning from streams. Its pipeline can include preprocessing, feature engineering, training, and low-latency inference; it provides algorithms for common tasks and interfaces for custom ones. section 8.4.2
The design changes operational responsibilities:
- Learning from arriving events can reduce the need to retain large historical datasets, but only when retaining them is not otherwise required. section 12.4.1
- Continuous updates require safeguards against concept drift, bias, and noise. Discarding consumed data can also make decisions harder to audit or reproduce. section 12.4.1
Figure 12.7 Retraining a machine learning model incrementally
The diagram shows the Kafka-connected model receiving events for incremental retraining, rather than waiting for a periodic batch-training cycle. section 12.4.1
