From 074ab0f5c5b496a97bedbd5658625928bd8b91c8 Mon Sep 17 00:00:00 2001 From: shubham1206agra Date: Sun, 6 Mar 2022 19:45:34 +0530 Subject: [PATCH] changing fn name acc to convention --- src/mlpack/core/math/quantile.hpp | 6 +++--- src/mlpack/core/tree/cosine_tree/cosine_tree.cpp | 2 +- src/mlpack/methods/kde/kde_rules_impl.hpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mlpack/core/math/quantile.hpp b/src/mlpack/core/math/quantile.hpp index 057e7a539a..d1178dd213 100644 --- a/src/mlpack/core/math/quantile.hpp +++ b/src/mlpack/core/math/quantile.hpp @@ -25,7 +25,7 @@ namespace math /** Miscellaneous math routines. */ { * * @param x Input value. */ -inline double erfinverse(double x) +inline double ErfInverse(double x) { double w, p; @@ -112,9 +112,9 @@ inline double erfinverse(double x) * @param mu Mean of the distribution. (Default 0) * @param sigma Standard deviation of the distribution. (Default 1) */ -inline double quantile(double p, double mu = 0.0, double sigma = 1.0) +inline double Quantile(double p, double mu = 0.0, double sigma = 1.0) { - return mu + sigma * std::sqrt(2.0) * erfinverse(2 * p - 1); + return mu + sigma * std::sqrt(2.0) * ErfInverse(2 * p - 1); } } // namespace math diff --git a/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp b/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp index c7e4c8d3cf..878d621b1d 100644 --- a/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp +++ b/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp @@ -477,7 +477,7 @@ double CosineTree::MonteCarloError(CosineTree* node, // Fit a normal distribution using the calculated statistics, and calculate a // lower bound on the magnitudes for the passed 'delta' parameter. - double lowerBound = math::quantile(delta, mu, sigma); + double lowerBound = math::Quantile(delta, mu, sigma); // Upper bound on the subspace reconstruction error. node->L2Error(node->FrobNormSquared() - lowerBound); diff --git a/src/mlpack/methods/kde/kde_rules_impl.hpp b/src/mlpack/methods/kde/kde_rules_impl.hpp index cd8200445c..062e740efa 100644 --- a/src/mlpack/methods/kde/kde_rules_impl.hpp +++ b/src/mlpack/methods/kde/kde_rules_impl.hpp @@ -191,7 +191,7 @@ Score(const size_t queryIndex, TreeType& referenceNode) // Monte Carlo probabilistic estimation. // Calculate z using accumulated alpha if possible. const double alpha = depthAlpha + accumMCAlpha(queryIndex); - const double z = std::abs(math::quantile(alpha / 2.0)); + const double z = std::abs(math::Quantile(alpha / 2.0)); // Auxiliary variables. arma::vec sample; @@ -398,7 +398,7 @@ Score(TreeType& queryNode, TreeType& referenceNode) // Monte Carlo probabilistic estimation. // Calculate z using accumulated alpha if possible. const double alpha = depthAlpha + queryStat.AccumAlpha(); - const double z = std::abs(math::quantile(alpha / 2)); + const double z = std::abs(math::Quantile(alpha / 2)); // Auxiliary variables. arma::vec sample;