mlpack_kde(1)

NAME
mlpack_kde - kernel density estimation

SYNOPSIS
 mlpack_kde [-E double] [-a string] [-b double] [-m unknown] [-k string] [-q string] [-r string] [-e double] [-t string] [-V bool] [-M unknown] [-p string] [-h -v]

DESCRIPTION
This program performs a Kernel Density Estimation. KDE is a non-parametric way of estimating probability density function. For each query point the program will estimate its probability density by applying a kernel function to each reference point. The computational complexity of this is O(N^2) where there are N query points and N reference points, but this implementation will typically see better performance as it uses an approximate dual or single tree algorithm for acceleration.

Dual or single tree optimization allows to avoid lots of barely relevant calculations (as kernel function values decrease with distance), so it is an approximate computation. You can specify the maximum relative error tolerance for each query value with '--rel_error (-e)' as well as the maximum absolute error tolerance with the parameter '--abs_error (-E)'. This program runs using an Euclidean metric. Kernel function can be selected using the '--kernel (-k)' option. You can also choose what which type of tree to use for the dual-tree algorithm with '--tree (-t)'. It is also possible to select whether to use dual-tree algorithm or single-tree algorithm using the '--algorithm (-a)' option.

For example, the following will run KDE using the data in 'ref_data.csv' for training and the data in 'qu_data.csv' as query data. It will apply an Epanechnikov kernel with a 0.2 bandwidth to each reference point and use a KD-Tree for the dual-tree optimization. The returned predictions will be within 5% of the real KDE value for each query point.

$ mlpack_kde --reference_file ref_data.csv --query_file qu_data.csv --bandwidth 0.2 --kernel epanechnikov --tree kd-tree --rel_error 0.05 --predictions_file out_data.csv

the predicted density estimations will be stored in 'out_data.csv'. If no '--query_file (-q)' is provided, then KDE will be computed on the ’--reference_file (-r)' dataset. It is possible to select either a reference dataset or an input model but not both at the same time.

OPTIONAL INPUT OPTIONS

--abs_error (-E) [double]
    Relative error tolerance for the prediction. Default value 0.

--algorithm (-a) [string]
    Algorithm to use for the prediction.('dual-tree', 'single-tree'). Default value 'dual-tree'.

--bandwidth (-b) [double]
    Bandwidth of the kernel. Default value 1.

--help (-h) [bool]
    Default help info.

--info [string]
    Print help on a specific option. Default value ''.

--input_model_file (-m) [unknown]
    Contains pre-trained KDE model.

--kernel (-k) [string]
    Kernel to use for the prediction.('gaussian', 'epanechnikov', 'laplacian', 'spherical', 'triangular'). Default value 'gaussian'.

--query_file (-q) [string]
    Query dataset to KDE on.

--reference_file (-r) [string]
    Input reference dataset use for KDE.

--rel_error (-e) [double]
    Relative error tolerance for the prediction. Default value 0.05.

--tree (-t) [string]
    Tree to use for the prediction.('kd-tree', 'ball-tree', 'cover-tree', 'octree', 'r-tree'). Default value 'kd-tree'.

--verbose (-v) [bool]
    Display informational messages and the full list of parameters and timers at the end of execution.

--version (-V) [bool]
    Display the version of mlpack.

OPTIONAL OUTPUT OPTIONS

--output_model_file (-M) [unknown]
    If specified, the KDE model will be saved here.

--predictions_file (-p) [string]
    Vector to store density predictions.nnADDITIONAL INFORMATIONNN FOR FURTHER INFORMATION, INCLUDING RELEVANT PAPERS, CITATIONS, AND THEORY, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.