[mlpack] 08/44: Backport r17274.

Barak A. Pearlmutter barak+git at pearlmutter.net
Mon Feb 15 19:35:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to tag mlpack-1.0.11
in repository mlpack.

commit 9acb6e49ff2a0315c6a01cf67acd3bb0ae29dd5d
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sun Dec 7 19:21:09 2014 +0000

    Backport r17274.
---
 HISTORY.txt                                      | 3 +++
 src/mlpack/core/metrics/mahalanobis_distance.hpp | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/HISTORY.txt b/HISTORY.txt
index 81ed204..4715b70 100644
--- a/HISTORY.txt
+++ b/HISTORY.txt
@@ -8,6 +8,9 @@
 
   * Add support for observation weights to LinearRegression.
 
+  * MahalanobisDistance<> now takes root of the distance by default and
+    therefore satisfies the triangle inequality (TakeRoot now defaults to true).
+
 2014-08-29    mlpack 1.0.10
 
   * Bugfix for NeighborSearch regression which caused very slow allknn/allkfn.
diff --git a/src/mlpack/core/metrics/mahalanobis_distance.hpp b/src/mlpack/core/metrics/mahalanobis_distance.hpp
index d7631b2..530cc0a 100644
--- a/src/mlpack/core/metrics/mahalanobis_distance.hpp
+++ b/src/mlpack/core/metrics/mahalanobis_distance.hpp
@@ -55,9 +55,11 @@ namespace metric {
  * which is faster to evaluate.
  *
  * @tparam TakeRoot If true, takes the root of the output.  It is slightly
- *   faster to leave this at the default of false.
+ *   faster to leave this at the default of false, but this means the metric may
+ *   not satisfy the triangle inequality and may not be usable for methods that
+ *   expect a true metric.
  */
-template<bool TakeRoot = false>
+template<bool TakeRoot = true>
 class MahalanobisDistance
 {
  public:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list