Driver for FFT based KDE algorithm. More...
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
Main function which reads parameters and determines which algorithms to run. |
Driver for FFT based KDE algorithm.
Definition in file fft_kde_main.cc.
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Main function which reads parameters and determines which algorithms to run.
In order to compile this driver, do: fl-build fft_kde_bin --mode=fast
In order to run this driver for the FFT-based KDE algorithm, type the following (which consists of both required and optional arguments) in a single command line:
./fft_kde_bin --data=name_of_the_reference_dataset --query=name_of_the_query_dataset --kde/bandwidth=0.0130619 --kde/scaling=range --kde/fft_kde_output=fft_kde_output.txt --kde/naive_kde_output=naive_kde_output.txt --kde/do_naive --kde/num_grid_pts_per_dim=128
Explanations for the arguments listed with possible values:
1. data (required): the name of the reference dataset
2. query (optional): the name of the query dataset (if missing, the query dataset is assumed to be the same as the reference dataset)
3. kde/bandwidth (required): smoothing parameter used for KDE; this has to be positive.
4. kde/scaling (optional): whether to prescale the dataset - range: scales both the query and the reference sets to be within the unit hypercube [0, 1]^D where D is the dimensionality. - none: default value; no scaling
5. kde/do_naive (optional): run the naive algorithm after the fast algorithm.
6. kde/fft_kde_output (optional): if this flag is present, the approximated density estimates are output to the filename provided after it.
7. kde/naive_kde_output (optional): if this flag is present, the exact density estimates computed by the naive algorithm are output to the filename provided after it. This flag is not ignored if --kde/do_naive flag is not present.
8. kde/num_grid_pts_per_dim (optional): specifies the number of grid points per each dimension (for discretizing and gridding the datasets). This is the only way to do any type of error control on approximated KDE values. In general, the higher the value, more accurate the density estimates will be. The default value is 128.
Definition at line 97 of file fft_kde_main.cc.
References NaiveKde< TKernel >::Compute(), FFTKde::Compute(), NaiveKde< TKernel >::ComputeMaximumRelativeError(), fx_done(), fx_param_exists(), fx_param_str(), fx_param_str_req(), fx_submodule(), FFTKde::get_density_estimates(), FFTKde::Init(), data::Load(), NaiveKde< TKernel >::PrintDebug(), FFTKde::PrintDebug(), and DatasetScaler::ScaleDataByMinMax().