encyclopegia.org

Online machine learning

In computer science, online machine learning is a method of machine learning in which data becomes available in a sequential order and is used to update the best predictor for future data at each step, as opposed to batch learning techniques which generate the best predictor by learning on the entire training data set at once.[src] Online learning is a common technique used in areas of machine learning where it is computationally infeasible to train over the entire dataset, requiring the need of out-of-core algorithms.[src] It is also used in situations where it is necessary for the algorithm to dynamically adapt to new patterns in the data, or when the data itself is generated as a function of time, e.g., prediction of prices in the financial international markets.[src] Online learning algorithms may be prone to catastrophic interference, a problem that can be addressed by incremental learning approaches.[src] Online machine learning algorithms find applications in a wide variety of fields such as sponsored search to maximize ad revenue, portfolio optimization, shortest path prediction (with stochastic weights, e.g.[src] traffic on roads for a maps application), spam filtering, real-time fraud detection, dynamic pricing for e-commerce, etc.[src] There is also growing interest in usage of online learning paradigms for LLMs to enable continuous, real-time adaptation after the initial training.[src]

In computer science, online machine learning is a method of machine learning in which data becomes available in a sequential order and is used to update the best predictor for future data at each step, as opposed to batch learning techniques which generate the best predictor by learning on the entire training data set at once.[src] Online learning is a common technique used in areas of machine learning where it is computationally infeasible to train over the entire dataset, requiring the need of out-of-core algorithms.[src] It is also used in situations where it is necessary for the algorithm to dynamically adapt to new patterns in the data, or when the data itself is generated as a function of time, e.g., prediction of prices in the financial international markets.[src] Online learning algorithms may be prone to catastrophic interference, a problem that can be addressed by incremental learning approaches.[src] Online machine learning algorithms find applications in a wide variety of fields such as sponsored search to maximize ad revenue, portfolio optimization, shortest path prediction (with stochastic weights, e.g.[src] traffic on roads for a maps application), spam filtering, real-time fraud detection, dynamic pricing for e-commerce, etc.[src] There is also growing interest in usage of online learning paradigms for LLMs to enable continuous, real-time adaptation after the initial training.[src] I[f] = \mathbb{E}[V(f(x), y)] = \int V(f(x), y)\,dp(x, y) \ .[src] A common paradigm in this situation is to estimate a function \hat{f} through empirical risk minimization or regularized empirical risk minimization (usually Tikhonov regularization).[src] The choice of loss function here gives rise to several well-known learning algorithms such as regularized least squares and support vector machines.[src] A purely online model in this category would learn based on just the new input (x_{t+1}, y_{t+1}) , the current best predictor f_{t} and some extra stored information (which is usually expected to have storage requirements independent of training data size).[src] For many formulations, for example nonlinear kernel methods, true online learning is not possible, though a form of hybrid online learning with recursive algorithms can be used where f_{t+1} is permitted to depend on f_t and all previous data points (x_1, y_1), \ldots, (x_t, y_t) .[src] In this case, the space requirements are no longer guaranteed to be constant since it requires storing all previous data points, but the solution may take less time to compute with the addition of a new data point, as compared to batch learning techniques.[src] A common strategy to overcome the above issues is to learn using mini-batches, which process a small batch of b \ge 1 data points at a time, this can be considered as pseudo-online learning for b much smaller than the total number of training points.[src] Mini-batch techniques are used with repeated passing over the training data to obtain optimized out-of-core versions of machine learning algorithms, for example, stochastic gradient descent.[src] When combined with backpropagation, this is currently the de facto training method for training artificial neural networks.[src] f(x_j) = \langle w,x_j\rangle = w \cdot x_j where x_j \in \mathbb{R}^d is a vector of inputs (data points) and w \in \mathbb{R}^d is a linear filter vector.[src] The goal is to compute the filter vector w .[src] To this end, a square loss function V(f(x_j), y_j) = (f(x_j) - y_j)^2 = (\langle w,x_j\rangle - y_j)^2 is used to compute the vector w that minimizes the empirical loss I_n[w] = \sum_{j=1}^{n} V(\langle w,x_j\rangle,y_j) = \sum_{j=1}^{n} (x_j^\mathsf{T}w-y_j)^2 where y_j \in \mathbb{R} .[src] Let X be the i \times d data matrix and y \in \mathbb{R}^i is the column vector of target values after the arrival of the first i data points.[src] Assuming that the covariance matrix \Sigma_i = X^\mathsf{T} X is invertible (otherwise it is preferential to proceed in a similar fashion with Tikhonov regularization), the best solution f^*(x) = \langle w^*, x \rangle to the linear least squares problem is given by w^* = (X^\mathsf{T}X)^{-1}X^\mathsf{T} y = \Sigma_i^{-1} \sum_{j=1}^{i} x_j y_j .[src] Now, calculating the covariance matrix \Sigma_i = \sum_{j=1}^{i} x_j x_j^\mathsf{T} takes time O(id^2) , inverting the d \times d matrix takes time O(d^3) , while the rest of the multiplication takes time O(d^2) , giving a total time of O(id^2 + d^3) .[src] When there are n total points in the dataset, to recompute the solution after the arrival of every datapoint i=1, \ldots, n , the naive approach will have a total complexity O(n^2d^2 + nd^3) .[src] Note that when storing the matrix \Sigma_i , then updating it at each step needs only adding x_{i+1} x_{i+1}^\mathsf{T} , which takes O(d^2) time, reducing the total time to O(nd^2 + nd^3) = O(nd^3) , but with an additional storage space of O(d^2) to store \Sigma_i .[src] ===Online learning: recursive least squares=== The recursive least squares (RLS) algorithm considers an online approach to the least squares problem.[src] It can be shown that by initialising \textstyle w_0 = 0 \in \mathbb{R}^d and \textstyle \Gamma_0 = I \in \mathbb{R}^{d \times d} , the solution of the linear least squares problem given in the previous section can be computed by the following iteration: \Gamma_i=\Gamma_{i-1}-\frac{\Gamma_{i-1} x_i x_i^\mathsf{T} \Gamma_{i-1}}{1+x_i^\mathsf{T}\Gamma_{i-1}x_i} w_i = w_{i-1}-\Gamma_i x_i \left(x_i^\mathsf{T} w_{i-1} - y_i\right) The above iteration algorithm can be proved using induction on i .[src] The proof also shows that \Gamma_i = \Sigma_i^{-1} .[src] One can look at RLS also in the context of adaptive filters (see RLS).[src] The complexity for n steps of this algorithm is O(nd^2) , which is an order of magnitude faster than the corresponding batch learning complexity.[src] The storage requirements at every step i here are to store the matrix \Gamma_i , which is constant at O(d^2) .[src] For the case when \Sigma_i is not invertible, consider the regularised version of the problem loss function \sum_{j=1}^{n} \left(x_j^\mathsf{T}w - y_j\right)^2 + \lambda \left\| w \right\|_2^2 .[src] Then, it's easy to show that the same algorithm works with \Gamma_0 = (I + \lambda I)^{-1} , and the iterations proceed to give \Gamma_i = (\Sigma_i + \lambda I)^{-1} .[src] ===Stochastic gradient descent=== When this w_i = w_{i-1} - \Gamma_i x_i \left(x_i^\mathsf{T} w_{i-1} - y_i\right) is replaced by w_i = w_{i-1} - \gamma_i x_i \left(x_i^\mathsf{T} w_{i-1} - y_i\right) = w_{i-1} - \gamma_i \nabla V(\langle w_{i-1}, x_i \rangle, y_i) or \Gamma_i \in \mathbb{R}^{d\times d} by \gamma_i \in \mathbb{R} , this becomes the stochastic gradient descent algorithm.[src] In this case, the complexity for n steps of this algorithm reduces to O(nd) .[src] The storage requirements at every step i are constant at O(d) .[src] However, the stepsize \gamma_i needs to be chosen carefully to solve the expected risk minimization problem, as detailed above.[src] By choosing a decaying step size \gamma_i \approx \frac{1}{\sqrt{i}}, one can prove the convergence of the average iterate \overline{w}_n = \frac{1}{n} \sum_{i=1}^{n} w_i .[src] This setting is a special case of stochastic optimization, a well known problem in optimization.[src] ===Incremental stochastic gradient descent=== In practice, one can perform multiple stochastic gradient passes (also called cycles or epochs) over the data.[src] The algorithm thus obtained is called incremental gradient method and corresponds to an iteration w_i = w_{i-1} - \gamma_i \nabla V(\langle w_{i-1}, x_{t_i} \rangle, y_{t_i}) The main difference with the stochastic gradient method is that here a sequence t_i is chosen to decide which training point is visited in the i -th step.[src] Such a sequence can be stochastic or deterministic.[src] The number of iterations is then decoupled to the number of points (each point can be considered more than once).[src] The incremental gradient method can be shown to provide a minimizer to the empirical risk.[src] Incremental techniques can be advantageous when considering objective functions made up of a sum of many terms e.g.[src] an empirical error corresponding to a very large dataset.[src] ===Kernel methods=== Kernels can be used to extend the above algorithms to non-parametric models (or models where the parameters form an infinite dimensional space).[src] The corresponding procedure will no longer be truly online and instead involve storing all the data points, but is still faster than the brute force method.[src] This discussion is restricted to the case of the square loss, though it can be extended to any convex loss.[src] It can be shown by an easy induction that if X_i is the data matrix and w_i is the output after i steps of the SGD algorithm, then, w_i = X_i^\mathsf{T} c_i where c_i = ((c_i)_1, (c_i)_2, ..., (c_i)_i) \in \mathbb{R}^i and the sequence c_i satisfies the recursion: c_0 = 0 (c_i)_j = (c_{i-1})_j, j=1,2,...,i-1 and (c_i)_i = \gamma_i \Big(y_i - \sum_{j=1}^{i-1} (c_{i-1})_j\langle x_j, x_i \rangle\Big) Notice that here \langle x_j, x_i \rangle is just the standard Kernel on \mathbb{R}^d , and the predictor is of the form f_i(x) = \langle w_{i-1},x \rangle = \sum_{j=1}^{i-1} (c_{i-1})_j \langle x_j,x \rangle.[src] Now, if a general kernel K is introduced instead and let the predictor be f_i(x) = \sum_{j=1}^{i-1} (c_{i-1})_j K(x_j,x) then the same proof will also show that predictor minimising the least squares loss is obtained by changing the above recursion to (c_i)_i = \gamma_i \Big(y_i - \sum_{j=1}^{i-1}(c_{i-1})_j K(x_j,x_i) \Big) The above expression requires storing all the data for updating c_i .[src] The total time complexity for the recursion when evaluating for the n -th datapoint is O(n^2 d k) , where k is the cost of evaluating the kernel on a single pair of points.[src] Thus, the use of the kernel has allowed the movement from a finite dimensional parameter space \textstyle w_{i} \in \mathbb{R}^d to a possibly infinite dimensional feature represented by a kernel K by instead performing the recursion on the space of parameters \textstyle c_{i} \in \mathbb{R}^i , whose dimension is the same as the size of the training dataset.[src] In general, this is a consequence of the representer theorem.[src] For t = 1,2,...,T Learner receives input x_t Learner outputs w_t from a fixed convex set S Nature sends back a convex loss function v_t : S \rightarrow \mathbb{R} .[src] Learner suffers loss v_t(w_t) and updates its model The goal is to minimize regret, or the difference between cumulative loss and the loss of the best fixed point u \in S in hindsight.[src] As an example, consider the case of online least squares linear regression.[src] Here, the weight vectors come from the convex set S = \mathbb{R}^d , and nature sends back the convex loss function v_t(w) = ( \langle w,x_t \rangle - y_t )^2 .[src] Note here that y_t is implicitly sent with v_t .[src] Some online prediction problems however cannot fit in the framework of OCO.[src] For example, in online classification, the prediction domain and the loss functions are not convex.[src] In such scenarios, two simple techniques for convexification are used: randomisation and surrogate loss functions .[src] Some simple online convex optimisation algorithms are: ==== Follow the leader (FTL)==== The simplest learning rule to try is to select (at the current step) the hypothesis that has the least loss over all past rounds.[src] This algorithm is called Follow the leader, and round t is simply given by: w_t = \mathop\operatorname{arg\,min}_{w \in S} \sum_{i=1}^{t-1} v_i(w) This method can thus be looked as a greedy algorithm.[src] For the case of online quadratic optimization (where the loss function is v_t(w) = \left\| w - x_t \right\|_2^2 ), one can show a regret bound that grows as \log(T) .[src] However, similar bounds cannot be obtained for the FTL algorithm for other important families of models like online linear optimization.[src] To do so, one modifies FTL by adding regularisation.[src] ==== Follow the regularised leader (FTRL)==== This is a natural modification of FTL that is used to stabilise the FTL solutions and obtain better regret bounds.[src] A regularisation function R : S \to \mathbb{R} is chosen and learning performed in round as follows: w_t = \mathop\operatorname{arg\,min}_{w \in S} \sum_{i=1}^{t-1}v_i(w) + R(w) As a special example, consider the case of online linear optimisation i.e.[src] where nature sends back loss functions of the form v_t(w) = \langle w,z_t \rangle .[src] Also, let S = \mathbb{R}^d .[src] Suppose the regularisation function R(w) = \frac{1}{2 \eta} \left\|w\right\|_2^2 is chosen for some positive number \eta .[src] Then, one can show that the regret minimising iteration becomes w_{t+1} = - \eta \sum_{i=1}^{t} z_i = w_t - \eta z_t Note that this can be rewritten as w_{t+1} = w_t - \eta \nabla v_t(w_t) , which looks exactly like online gradient descent.[src] If is instead some convex subspace of \mathbb{R}^d , would need to be projected onto, leading to the modified update rule w_{t+1} = \Pi_S(- \eta \sum_{i=1}^{t} z_i) = \Pi_S(\eta \theta_{t+1}) This algorithm is known as lazy projection, as the vector \theta_{t+1} accumulates the gradients.[src] It is also known as Nesterov's dual averaging algorithm.[src] In this scenario of linear loss functions and quadratic regularisation, the regret is bounded by O(\sqrt{T}) , and thus the average regret goes to as desired.[src] The above proved a regret bound for linear loss functions v_t(w) = \langle w, z_t \rangle .[src] To generalise the algorithm to any convex loss function, the subgradient \partial v_t(w_t) of v_t is used as a linear approximation to v_t near w_t , leading to the online subgradient descent algorithm: Initialise parameter \eta, w_1 = 0 For t = 1,2,...,T Predict using w_t , receive f_t from nature.[src] Choose z_t \in \partial v_t(w_t) If S = \mathbb{R}^d , update as w_{t+1} = w_t - \eta z_t If S \subset \mathbb{R}^d , project cumulative gradients onto S i.e.[src] w_{t+1} = \Pi_S(\eta\theta_{t+1}) , \theta_{t+1} = \theta_t + z_t One can use the OSD algorithm to derive O(\sqrt{T}) regret bounds for the online version of SVM's for classification, which use the hinge loss v_t(w) = \max \{ 0, 1 - y_t(w \cdot x_t) \} w_t = w_{t-1} - \gamma_t \nabla V(\langle w_{t-1}, x_t \rangle, y_t) The first interpretation consider the stochastic gradient descent method as applied to the problem of minimizing the expected risk I[w] defined above.[src] Indeed, in the case of an infinite stream of data, since the examples (x_1, y_1), (x_2, y_2), \ldots are assumed to be drawn i.i.d.[src] from the distribution p(x,y) , the sequence of gradients of V(\cdot, \cdot) in the above iteration are an i.i.d.[src] sample of stochastic estimates of the gradient of the expected risk I[w] and therefore one can apply complexity results for the stochastic gradient descent method to bound the deviation I[w_t] - I[w^\ast] , where w^\ast is the minimizer of I[w] .[src] This interpretation is also valid in the case of a finite training set; although with multiple passes through the data the gradients are no longer independent, still complexity results can be obtained in special cases.[src] The second interpretation applies to the case of a finite training set and considers the SGD algorithm as an instance of incremental gradient descent method.[src] In this case, one instead looks at the empirical risk: I_n[w] = \frac{1}{n}\sum_{i = 1}^n V(\langle w,x_i \rangle, y_i) \ .[src] Since the gradients of V(\cdot, \cdot) in the incremental gradient descent iterations are also stochastic estimates of the gradient of I_n[w] , this interpretation is also related to the stochastic gradient descent method, but applied to minimize the empirical risk as opposed to the expected risk.[src] Since this interpretation concerns the empirical risk and not the expected risk, multiple passes through the data are readily allowed and actually lead to tighter bounds on the deviations I_n[w_t] - I_n[w^\ast_n] , where w^\ast_n is the minimizer of I_n[w] .[src] ==See also== Learning paradigms Incremental learning Lazy learning Offline learning, the opposite model Reinforcement learning Multi-armed bandit Supervised learning General algorithms Online algorithm Online optimization Streaming algorithm Stochastic gradient descent Learning models Adaptive Resonance Theory Hierarchical temporal memory k-nearest neighbor algorithm Learning vector quantization Perceptron ==References== ==External links== 6.883: Online Methods in Machine Learning: Theory and Applications.[src] Alexander Rakhlin.[src] MIT[src]

97 sentences · 97 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Online machine learning." encyclopegia.org, 2026, https://encyclopegia.org/wiki/online-machine-learning. Accessed 29 November 2026.

Chicago

"Online machine learning." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/online-machine-learning.

APA

encyclopegia.org. (2026). Online machine learning. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/online-machine-learning

Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Internet Archive Wayback Machine

article · references available

automated teller machine

stub · references available

lazy learning

stub · references available

explanation-based learning

stub · references available

Z-machine

stub · references available

watch timing machine

stub · references available

deep learning

stub · references available

vending machine

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1378451425 · 0.5 · snapshot enwiki-001378451425

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.