KDERules< MetricType, KernelType, TreeType > Class Template Reference

A dual-tree traversal Rules class for kernel density estimation. More...

Public Types

typedef tree::TraversalInfo< TreeType > TraversalInfoType
 

Public Member Functions

 KDERules (const arma::mat &referenceSet, const arma::mat &querySet, arma::vec &densities, const double relError, const double absError, const double mcProb, const size_t initialSampleSize, const double mcAccessCoef, const double mcBreakCoef, MetricType &metric, KernelType &kernel, const bool monteCarlo, const bool sameSet)
 Construct KDERules. More...

 
double BaseCase (const size_t queryIndex, const size_t referenceIndex)
 Base Case. More...

 
size_t BaseCases () const
 Get the number of base cases. More...

 
size_t MinimumBaseCases () const
 Get the minimum number of base cases we need to perform to have acceptable results. More...

 
double Rescore (const size_t queryIndex, TreeType &referenceNode, const double oldScore) const
 SingleTree Score. More...

 
double Rescore (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const
 Dual-Tree Rescore. More...

 
double Score (const size_t queryIndex, TreeType &referenceNode)
 SingleTree Rescore. More...

 
double Score (TreeType &queryNode, TreeType &referenceNode)
 Dual-Tree Score. More...

 
size_t Scores () const
 Get the number of scores. More...

 
const TraversalInfoTypeTraversalInfo () const
 Get traversal information. More...

 
TraversalInfoTypeTraversalInfo ()
 Modify traversal information. More...

 

Detailed Description


template
<
typename
MetricType
,
typename
KernelType
,
typename
TreeType
>

class mlpack::kde::KDERules< MetricType, KernelType, TreeType >

A dual-tree traversal Rules class for kernel density estimation.

This contains the Score() and BaseCase() implementations.

Definition at line 26 of file kde_rules.hpp.

Member Typedef Documentation

◆ TraversalInfoType

Definition at line 82 of file kde_rules.hpp.

Constructor & Destructor Documentation

◆ KDERules()

KDERules ( const arma::mat &  referenceSet,
const arma::mat &  querySet,
arma::vec &  densities,
const double  relError,
const double  absError,
const double  mcProb,
const size_t  initialSampleSize,
const double  mcAccessCoef,
const double  mcBreakCoef,
MetricType &  metric,
KernelType &  kernel,
const bool  monteCarlo,
const bool  sameSet 
)

Construct KDERules.

Parameters
referenceSetReference set data.
querySetQuery set data.
densitiesVector where estimations will be written.
relErrorRelative error tolerance.
absErrorAbsolute error tolerance.
mcProbProbability of relative error compliance for Monte Carlo estimations.
initialSampleSizeInitial size of the Monte Carlo samples.
mcAccessCoefAccess coefficient for Monte Carlo estimations.
mcBreakCoefBreak coefficient for Monte Carlo estimations.
metricInstantiated metric.
kernelInstantiated kernel.
monteCarloIf true Monte Carlo estimations will be applied when possible.
sameSetTrue if query and reference sets are the same (monochromatic evaluation).

Member Function Documentation

◆ BaseCase()

double BaseCase ( const size_t  queryIndex,
const size_t  referenceIndex 
)

Base Case.

Referenced by KDECleanRules< TreeType >::KDECleanRules().

◆ BaseCases()

size_t BaseCases ( ) const
inline

Get the number of base cases.

Definition at line 91 of file kde_rules.hpp.

◆ MinimumBaseCases()

size_t MinimumBaseCases ( ) const
inline

Get the minimum number of base cases we need to perform to have acceptable results.

Definition at line 98 of file kde_rules.hpp.

◆ Rescore() [1/2]

double Rescore ( const size_t  queryIndex,
TreeType &  referenceNode,
const double  oldScore 
) const

SingleTree Score.

◆ Rescore() [2/2]

double Rescore ( TreeType &  queryNode,
TreeType &  referenceNode,
const double  oldScore 
) const

Dual-Tree Rescore.

◆ Score() [1/2]

double Score ( const size_t  queryIndex,
TreeType &  referenceNode 
)

◆ Score() [2/2]

double Score ( TreeType &  queryNode,
TreeType &  referenceNode 
)

Dual-Tree Score.

◆ Scores()

size_t Scores ( ) const
inline

Get the number of scores.

Definition at line 94 of file kde_rules.hpp.

◆ TraversalInfo() [1/2]

const TraversalInfoType& TraversalInfo ( ) const
inline

Get traversal information.

Definition at line 85 of file kde_rules.hpp.

◆ TraversalInfo() [2/2]

TraversalInfoType& TraversalInfo ( )
inline

Modify traversal information.

Definition at line 88 of file kde_rules.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/kde/kde_rules.hpp