![]() |
STAG Python
2.0.2
Spectral Toolkit of Algorithms for Graphs
|
A data structure for computing the exact Gauussian KDE.
This data structure uses a brute-force algorithm to compute the kernel density of each query point.
The time complexity of initialisation with \(n\) data points is \(O(1)\). The query time complexity is \(O(m n d)\), where \(m\) is the number of query points, and \(d\) is the dimensionality of the data.
Public Member Functions | |
| def | __init__ (self, stag.utility.DenseMat data, float a) |
| Initialise the data structure with the given dataset and Gaussian kernel parameter \(a\). | |
| Union[float, np.ndarray] | query (self, Union[stag.utility.DenseMat, stag.data.DataPoint] q) |
| Calculate the exact kernel density estimates for the given query points. | |
Public Attributes | |
| internal_kde | |
| def stag.kde.ExactGaussianKDE.__init__ | ( | self, | |
| stag.utility.DenseMat | data, | ||
| float | a | ||
| ) |
Initialise the data structure with the given dataset and Gaussian kernel parameter \(a\).
The initialisation time for this data structure is \(O(1)\).
| data | |
| a |
| Union[float, np.ndarray] stag.kde.ExactGaussianKDE.query | ( | self, | |
| Union[stag.utility.DenseMat, stag.data.DataPoint] | q | ||
| ) |
Calculate the exact kernel density estimates for the given query points.
The parameter q can be either a stag.data.DataPoint object to query one data point, or a stag.utility.DenseMat matrix with the query points as rows in order to query many data points.
For querying many data points, passing the queries as a DenseMat will be more efficient.
| q | the query data point(s) |
| stag.kde.ExactGaussianKDE.internal_kde |