Skip to content

Commit

Permalink
Document complexity of online algorithm
Browse files Browse the repository at this point in the history
Closes #2
  • Loading branch information
jgosmann committed Aug 19, 2023
1 parent 582731b commit 035f788
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Added
^^^^^

* Official support for Python 3.9, 3.10, and 3.11.
* Documented computational complexity of adding new data to an online Gaussian
Process.

Removed
^^^^^^^
Expand Down
15 changes: 14 additions & 1 deletion goppy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,22 @@ def fit(self, x, y):
self.trained = True

def add(self, x, y):
"""Adds additional training data to the Gaussian process and adjusts
r"""Adds additional training data to the Gaussian process and adjusts
the fit.
The complexity of this method is in :math:`O(n \cdot \max(n^2, N^2))`
where
* :math:`n` is the number of data points being added,
* and :math:`N` is the total number of data points added so far.
This is better than re-initializing the Gaussian process, which would
have a complexity in :math:`O((n + N)^3)` because of the matrix
inversion.
`See this master's thesis for more details.
<https://github.com/jgosmann/goppy/files/11995181/thesis.pdf>`_
Parameters
----------
x : (`N`, `D`) array-like
Expand Down

0 comments on commit 035f788

Please sign in to comment.