diff --git a/Sources/Accord.Math/Accord.Math.csproj b/Sources/Accord.Math/Accord.Math.csproj index 77041f462..d9b144508 100644 --- a/Sources/Accord.Math/Accord.Math.csproj +++ b/Sources/Accord.Math/Accord.Math.csproj @@ -120,6 +120,7 @@ + diff --git a/Sources/Accord.Statistics/Dissimilarity.cs b/Sources/Accord.Math/Dissimilarity.cs similarity index 73% rename from Sources/Accord.Statistics/Dissimilarity.cs rename to Sources/Accord.Math/Dissimilarity.cs index 5738d0741..c8bc6632f 100644 --- a/Sources/Accord.Statistics/Dissimilarity.cs +++ b/Sources/Accord.Math/Dissimilarity.cs @@ -1,24 +1,45 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Accord.Statistics +// Accord Math Library +// The Accord.NET Framework +// http://accord-framework.net +// +// Copyright © Diego Catalano, 2014 +// diego.catalano at live.com +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// + +namespace Accord.Math { + /// - /// Static class Dissimilarity. Defines a set of extension methods defining dissimilarity measures. + /// Static class Dissimilarity. Provides extension methods defining dissimilarity measures. /// + /// public static class Dissimilarity { /// - /// Gets the Dice dissimilarity between two vectors. + /// Computes the Dice dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Dice dissimilarity between x and y. + /// public static double Dice(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -34,14 +55,16 @@ public static double Dice(int[] x, int[] y) } /// - /// Gets the Jaccard dissimilarity between two vectors. + /// Computes the Jaccard dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Jaccard dissimilarity between x and y. + /// public static double Jaccard(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -57,14 +80,16 @@ public static double Jaccard(int[] x, int[] y) } /// - /// Gets the Kulsinsk dissimilarity between two vectors. + /// Computes the Kulsinsk dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Kulsinsk dissimilarity between x and y. + /// public static double Kulsinsk(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -80,14 +105,16 @@ public static double Kulsinsk(int[] x, int[] y) } /// - /// Gets the Matching dissimilarity between two vectors. + /// Computes the Matching dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Matching dissimilarity between x and y. + /// public static double Matching(int[] x, int[] y) { - int tf = 0; int ft = 0; @@ -101,14 +128,16 @@ public static double Matching(int[] x, int[] y) } /// - /// Gets the Rogers Tanimoto dissimilarity between two vectors. + /// Computes the Rogers-Tanimoto dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Rogers Tanimoto dissimilarity between x and y. + /// public static double RogersTanimoto(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -127,14 +156,16 @@ public static double RogersTanimoto(int[] x, int[] y) } /// - /// Gets the Russel Rao dissimilarity between two vectors. + /// Computes the Russel Rao dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Russel Rao dissimilarity between x and y. + /// public static double RusselRao(int[] x, int[] y) { - int tt = 0; for (int i = 0; i < x.Length; i++) @@ -146,14 +177,16 @@ public static double RusselRao(int[] x, int[] y) } /// - /// Gets the Sokal Michener dissimilarity between two vectors. + /// Computes the Sokal-Michener dissimilarity between two vectors. /// + /// /// A vector. /// A vector. - /// The Sokal Michener dissimilarity between x and y. + /// + /// The Sokal-Michener dissimilarity between x and y. + /// public static double SokalMichener(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -172,14 +205,16 @@ public static double SokalMichener(int[] x, int[] y) } /// - /// Gets the Sokal Sneath dissimilarity between two vectors. + /// Computes the Sokal Sneath dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Sokal Sneath dissimilarity between x and y. + /// public static double SokalSneath(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -196,14 +231,16 @@ public static double SokalSneath(int[] x, int[] y) } /// - /// Gets the Yule dissimilarity between two vectors. + /// Computes the Yule dissimilarity between two vectors. /// + /// /// A vector. /// A vector. + /// /// The Yule dissimilarity between x and y. + /// public static double Yule(int[] x, int[] y) { - int tf = 0; int ft = 0; int tt = 0; @@ -220,5 +257,6 @@ public static double Yule(int[] x, int[] y) double r = 2 * (tf + ft); return r / (tt + ff + r / 2); } + } } diff --git a/Sources/Accord.Statistics/Accord.Statistics.csproj b/Sources/Accord.Statistics/Accord.Statistics.csproj index b4f6d4548..24f373e56 100644 --- a/Sources/Accord.Statistics/Accord.Statistics.csproj +++ b/Sources/Accord.Statistics/Accord.Statistics.csproj @@ -152,7 +152,6 @@ -