smile.math.distance

Distance functions.

Attributes

Members list

Type members

Classlikes

class Hamming extends Distance[Array[Int]]

Hamming distance between two bit strings. Note that we treat each integer in the input array as a bit string. In contrast, HammingDistance treats each integer in the input array as a single value.

Hamming distance between two bit strings. Note that we treat each integer in the input array as a bit string. In contrast, HammingDistance treats each integer in the input array as a single value.

Attributes

Supertypes
trait Distance[Array[Int]]
trait Serializable
trait ToDoubleBiFunction[Array[Int], Array[Int]]
class Object
trait Matchable
class Any
Show all
class MeanMahanttan extends Distance[Array[Int]]

Mean Mahantan distance. Compared to regular Manhattan distance, it normalizes the distance by the sum of contingency table values.

Mean Mahantan distance. Compared to regular Manhattan distance, it normalizes the distance by the sum of contingency table values.

== References ==

Attributes

Supertypes
trait Distance[Array[Int]]
trait Serializable
trait ToDoubleBiFunction[Array[Int], Array[Int]]
class Object
trait Matchable
class Any
Show all
class PatternDifference extends Distance[Array[Int]]

Pattern difference distance.

Pattern difference distance.

== References ==

Attributes

Supertypes
trait Distance[Array[Int]]
trait Serializable
trait ToDoubleBiFunction[Array[Int], Array[Int]]
class Object
trait Matchable
class Any
Show all
class ShapeDifference extends Distance[Array[Int]]

Shape Difference distance.

Shape Difference distance.

== References ==

Attributes

Supertypes
trait Distance[Array[Int]]
trait Serializable
trait ToDoubleBiFunction[Array[Int], Array[Int]]
class Object
trait Matchable
class Any
Show all
class SizeDifference extends Distance[Array[Int]]

Size Difference distance.

Size Difference distance.

== References ==

Attributes

Supertypes
trait Distance[Array[Int]]
trait Serializable
trait ToDoubleBiFunction[Array[Int], Array[Int]]
class Object
trait Matchable
class Any
Show all
class Vari extends Distance[Array[Int]]

Vari distance class.

Vari distance class.

== References ==

Attributes

Supertypes
trait Distance[Array[Int]]
trait Serializable
trait ToDoubleBiFunction[Array[Int], Array[Int]]
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def contingency(x: Array[Int], y: Array[Int]): (Int, Int, Int, Int)

Build the contingency matrix (a, b, c, d) where for each bite i, j of vector 1 and 2 :

Build the contingency matrix (a, b, c, d) where for each bite i, j of vector 1 and 2 :

  • a is incremented if i = 1, j = 1
  • b is incremented if i = 1, j = 0
  • c is incremented if i = 0, j = 1
  • d is incremented if i = 0, j = 0

Attributes