mlpack
Classes | Macros | Functions
kde_test.cpp File Reference
#include <string>
#include <mlpack/core.hpp>
#include <mlpack/core/util/mlpack_main.hpp>
#include "test_helper.hpp"
#include <mlpack/methods/kde/kde_main.cpp>
#include "../catch.hpp"
Include dependency graph for kde_test.cpp:

Classes

struct  KDETestFixture
 

Macros

#define BINDING_TYPE   BINDING_TYPE_TEST
 

Functions

void ResetKDESettings ()
 
 TEST_CASE_METHOD (KDETestFixture, "KDEGaussianRTreeResultsMain", "[KDEMainTest][BindingTests]")
 Ensure that the estimations we get for KDEMain, are the same as the ones we get from the KDE class without any wrappers. More...
 
 TEST_CASE_METHOD (KDETestFixture, "KDETriangularBallTreeResultsMain", "[KDEMainTest][BindingTests]")
 Ensure that the estimations we get for KDEMain, are the same as the ones we get from the KDE class without any wrappers. More...
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMonoResultsMain", "[KDEMainTest][BindingTests]")
 Ensure that the estimations we get for KDEMain, are the same as the ones we get from the KDE class without any wrappers in the monochromatic case.
 
 TEST_CASE_METHOD (KDETestFixture, "KDENoInputData", "[KDEMainTest][BindingTests]")
 Ensuring that absence of input data is checked.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEOutputSize", "[KDEMainTest][BindingTests]")
 Check result has as many densities as query points.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEModelReuse", "[KDEMainTest][BindingTests]")
 Check that saved model can be reused.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEGaussianSingleKDTreeResultsMain", "[KDEMainTest][BindingTests]")
 Ensure that the estimations we get for KDEMain, are the same as the ones we get from the KDE class without any wrappers using single-tree mode.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidKernel", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid kernel is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidTree", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid tree is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidAlgorithm", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid algorithm is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainReferenceAndModel", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when both reference and input_model are specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidAbsoluteError", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid absolute error is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidRelativeError", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid relative error is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidMCProbability", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid Monte Carlo probability is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidMCInitialSampleSize", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid Monte Carlo initial sample size is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidMCEntryCoef", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid Monte Carlo entry coefficient is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainInvalidMCBreakCoef", "[KDEMainTest][BindingTests]")
 Ensure we get an exception when an invalid Monte Carlo break coefficient is specified.
 
 TEST_CASE_METHOD (KDETestFixture, "KDEMainMonteCarloFlag", "[KDEMainTest][BindingTests]")
 Ensure when –monte_carlo flag is true, then KDEMain actually uses Monte Carlo estimations. More...
 

Detailed Description

Author
Roberto Hueso

Test mlpackMain() of kde_main.cpp

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Function Documentation

◆ TEST_CASE_METHOD() [1/3]

TEST_CASE_METHOD ( KDETestFixture  ,
"KDEGaussianRTreeResultsMain"  ,
""  [KDEMainTest][BindingTests] 
)

Ensure that the estimations we get for KDEMain, are the same as the ones we get from the KDE class without any wrappers.

Requires normalization.

◆ TEST_CASE_METHOD() [2/3]

TEST_CASE_METHOD ( KDETestFixture  ,
"KDETriangularBallTreeResultsMain"  ,
""  [KDEMainTest][BindingTests] 
)

Ensure that the estimations we get for KDEMain, are the same as the ones we get from the KDE class without any wrappers.

Doesn't require normalization.

◆ TEST_CASE_METHOD() [3/3]

TEST_CASE_METHOD ( KDETestFixture  ,
"KDEMainMonteCarloFlag"  ,
""  [KDEMainTest][BindingTests] 
)

Ensure when –monte_carlo flag is true, then KDEMain actually uses Monte Carlo estimations.

Since this test has a random component, it might fail (although it's unlikely).