Skip to main content
19 votes

What is the difference between online and batch Learning?

In short, Online: Learning based on each pattern as it is observed. Batch: Learning over groups of patters. Most algorithms are batch. Source: http://machinelearningmastery.com/basic-concepts-in-...
Dr Nisha Arora's user avatar
13 votes
Accepted

Recursively updating the MLE as new observations stream in

See the concept of sufficiency and in particular, minimal sufficient statistics. In many cases you need the whole sample to compute the estimate at a given sample size, with no trivial way to update ...
Glen_b's user avatar
  • 291k
11 votes
Accepted

sequential/recursive/online calculation of sample covariance matrix

It's easy if you write $$ \hat\Sigma_n= \frac{1}{n-1}\sum_{i=1}^nX_i X_i^T - \frac{n}{n-1}\hat{\mu}_n\hat{\mu}_n^T. $$ Split up the sum over $n$ elements into two parts. One will involve the first $n-...
Taylor's user avatar
  • 21.6k
9 votes

Online update of Pearson coefficient

Recall the formula for the sample Pearson correlation between two vectors $x\in\mathbb{R}^n$ and $y\in\mathbb{R}^n$ (Eq. 3 in Wikipedia): $$ r = \frac{\sum_{i=1}^n(x_i-\overline{x})(y_i-\overline{y})}{...
Stephan Kolassa's user avatar
8 votes
Accepted

How do I normalize data in online learning?

In an ideal world, our training data should be representative of the production data, which means that the descriptive statistics (such as the mean, max, or min) should not change too much. Thus, in ...
Haitao Du's user avatar
  • 37.3k
7 votes

Efficient online linear regression

Surprised no one else touched on this so far. Linear regression has a quadratic objective function. So, a newton Raphson step from any starting point leads you straight to the optima. Now, let's say ...
ryu576's user avatar
  • 2,630
7 votes

Online vs offline learning?

Online learning (also called incremental learning): we consider a single presentation of the examples. In this case, each example is used sequentially in a manner as prescribed by the learning ...
FrankyBravo's user avatar
7 votes

Are Bandit Algorithms Considered as Online Algorithms?

Multi-armed bandit is a problem, not algorithm, there are multiple algorithms for solving it. Depending on your solution, you could solve it in online, or offline fashion. For example, you could ...
Tim's user avatar
  • 141k
7 votes

Using Gaussian Processes to learn a function online

This is pretty straightforward to do with Bayesian learning since it corresponds to sequentially updating the posterior over $f$ as more and more data comes in. Bayesian optimization uses this a lot ...
jld's user avatar
  • 20.8k
7 votes
Accepted

Doubt about level of confidence

First, I want to reinforce two caveats from comments: (a) Per @Dave: $n = 100$ may be too small to see a clear pattern. If you have one defective part among 99 good parts in a sample of size 100, then ...
BruceET's user avatar
  • 57.6k
7 votes

Linear regression on a large dataset

There are specialized algorithms that allow estimating a least squares problem iteratively, so you don't have to have the entire dataset in memory, but can update your solution by iterating over the ...
Stephan Kolassa's user avatar
6 votes

Online update of Pearson coefficient

A few observations on Stephan Kolassa's answer: Computing the incremental averages as follows is more numerically robust in practice: $$ \bar{x}_{n+1} = \bar{x}_{n} + \frac{x_{n+1} - \bar{x}_{n}}{n+1} ...
Marcos Slomp's user avatar
6 votes

Reducing the dataset size for KDE

First off, KDE computation is usually performed with the Fast Fourier Transform (FFT). This algorithm requires $O(N\log N)$ computational time to represent the KDE on a grid of $N$ cells (even in ...
whuber's user avatar
  • 334k
5 votes

How do I normalize data in online learning?

One possibility is to update statistics (mean, variance, min, max, etc.) using all historical data in an online manner and use them to normalize your data. Welford's online algorithm is such an ...
Sun Haozhe's user avatar
5 votes

kalman filter multiple observations per time step

Most of the time, implementing a Kalman filter with multiple observations falls under the data fusion or sensor fusion umbrella. In general, there is no single way to approach the problem. For a ...
scherm's user avatar
  • 1,035
5 votes

Recursively updating the MLE as new observations stream in

In machine learning, this is referred to as online learning. As @Glen_b pointed out, there are special cases in which the MLE can be updated without needing to access all the previous data. As he ...
Cliff AB's user avatar
  • 21.6k
4 votes

Online estimation of quartiles without storing observations

A very slight change to the method you posted and you can compute any arbitrary percentile, without having to compute all of the quantiles. Here's the Python code: ...
parrowdice's user avatar
4 votes

Online convex optimization: Why use strongly convex regularizer for regularized-follow-the-leader instead of strictly convex (or just convex)

This is actually quite an interesting question. It's best to think of the RFTL algorithm as most naturally working with quadratic norms $R(x)=||x||_A^2$ for some positive definite matrix $A$. If you ...
AaronDefazio's user avatar
  • 1,614
4 votes

what is the simplest possible online learning model / algorithm

You want to calculate the average height of persons. An online algorithm that implements this keeps track of the total height of the persons the algorithm has seen, and the number of persons the ...
Gijs's user avatar
  • 4,092
4 votes

How to calculate the running mean absolute deviation

There is no (useful) exact recursion, but there is an approximate one Since your comment specified that you prefer to use the MAD around the mean, I will proceed for that case. Given an observed ...
Ben's user avatar
  • 133k
4 votes
Accepted

Online updating of $t$-value for simple linear regression

Define n, sx, sy, sxx, sxy, syy \begin{align}s_x & = \sum{x_i},\\s_y &= \sum{y_i}, \\s_{xx} &= \sum{(x_i \times x_i)}, \\s_{yy} &= \sum{(y_i \times y_i)}, \\s_{xy} & = \sum{(x_i \...
wei's user avatar
  • 723
3 votes

How do I normalize data in online learning?

I encountered this issue when I put a classifier into production. The two alternatives we considered were: 1. To use historical data's (as has been proposed in other questions) metrics (min, max, sdv) ...
boski's user avatar
  • 155
3 votes

is K-Means clustering suited to real time applications?

Check RTEFC or RTMAC, which are efficient, simple real-time variants of K-means, suited for tracking sequences of similar vectors. RTEFC in particular. See http://gregstanleyandassociates.com/...
gms's user avatar
  • 341
3 votes
Accepted

Calculating mean and SD from a stream of numbers

Have you checked on Wikipedia how M2 is supposed to be used? It says that you must divide by count to get the variance. Divide M2 by 7 and you get the correct answer. The sum of squares of differences ...
andfor's user avatar
  • 531
3 votes

How to frequently update classification model with new training data?

Most models in python or R libraries need to be retrained from scratch. Bayesian models can, in theory, incorporate new observations sequentially, but in practice it is often the case that they are ...
Demetri Pananos's user avatar
3 votes

Online update of Pearson coefficient

It's worth noting that the other answers here do not calculate the same thing as calculating $r$ at the end. They use the current value of $\bar{x}$ for each step of accumulation, rather than the true ...
Multihunter's user avatar
3 votes
Accepted

What is the best strategy for the simplified version of the multi-armed bandit?

As discussed in the comments, this is not exactly a multi-armed bandit problem. In multi-armed bandit you know the rewards only after you "pull the arm" of your slot machine. For example, if you are ...
Tim's user avatar
  • 141k
3 votes

Incremental update of Normal Distribution

Assuming that we are talking about the data that can be thought of as independent and identically distributed variables, you could just use the Welford algorithm, an algorithm that simultaneously ...
Tim's user avatar
  • 141k
2 votes

Recursive (online) regularised least squares algorithm

Here is an alternative (and less complex) approach compared to using the Woodbury formula. Note that $X^TX$ and $X^Ty$ can be written as sums. Since we are calculating things online and don't want ...
joshday's user avatar
  • 31
2 votes

What is the precise definition of a "Heywood Case"?

From the APA dictionary of psychology: [...] any correlation coefficient, regression coefficient, factor loading, or similar parameter estimate having a value that is impossible or very rare (e.g., a ...
in2td's user avatar
  • 21

Only top scored, non community-wiki answers of a minimum length are eligible