Package

smile

util

Permalink

package util

Utility functions.

Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. util
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait Logging extends AnyRef

    Permalink

Value Members

  1. def gaussrbf[T <: AnyRef](x: Array[T], centers: Array[T], distance: Metric[T], r: Double): Array[GaussianRadialBasis]

    Permalink

    Learns Gaussian RBF function and centers from data.

    Learns Gaussian RBF function and centers from data. The centers are chosen as the medoids of CLARANS. The standard deviation (i.e. width) of Gaussian radial basis function is estimated as the width of each cluster multiplied with a given scaling parameter r.

    x

    the training dataset.

    centers

    an array to store centers on output. Its length is used as k of CLARANS.

    distance

    the distance functor.

    r

    the scaling parameter.

    returns

    Gaussian RBF functions with parameter learned from data.

  2. def gaussrbf[T <: AnyRef](x: Array[T], centers: Array[T], distance: Metric[T], p: Int): Array[GaussianRadialBasis]

    Permalink

    Learns Gaussian RBF function and centers from data.

    Learns Gaussian RBF function and centers from data. The centers are chosen as the medoids of CLARANS. The standard deviation (i.e. width) of Gaussian radial basis function is estimated by the p-nearest neighbors (among centers, not all samples) heuristic. A suggested value for p is 2.

    x

    the training dataset.

    centers

    an array to store centers on output. Its length is used as k of CLARANS.

    distance

    the distance functor.

    p

    the number of nearest neighbors of centers to estimate the width of Gaussian RBF functions.

    returns

    Gaussian RBF functions with parameter learned from data.

  3. def gaussrbf[T <: AnyRef](x: Array[T], centers: Array[T], distance: Metric[T]): GaussianRadialBasis

    Permalink

    Learns Gaussian RBF function and centers from data.

    Learns Gaussian RBF function and centers from data. The centers are chosen as the medoids of CLARANS. Let dmax be the maximum distance between the chosen centers, the standard deviation (i.e. width) of Gaussian radial basis function is dmax / sqrt(2*k), where k is number of centers. In this way, the radial basis functions are not too peaked or too flat. This choice would be close to the optimal solution if the data were uniformly distributed in the input space, leading to a uniform distribution of medoids.

    x

    the training dataset.

    centers

    an array to store centers on output. Its length is used as k of CLARANS.

    distance

    the distance functor.

    returns

    a Gaussian RBF function with parameter learned from data.

  4. def gaussrbf(x: Array[Array[Double]], centers: Array[Array[Double]], r: Double): Array[GaussianRadialBasis]

    Permalink

    Learns Gaussian RBF function and centers from data.

    Learns Gaussian RBF function and centers from data. The centers are chosen as the centroids of K-Means. The standard deviation (i.e. width) of Gaussian radial basis function is estimated as the width of each cluster multiplied with a given scaling parameter r.

    x

    the training dataset.

    centers

    an array to store centers on output. Its length is used as k of k-means.

    r

    the scaling parameter.

    returns

    Gaussian RBF functions with parameter learned from data.

  5. def gaussrbf(x: Array[Array[Double]], centers: Array[Array[Double]], p: Int): Array[GaussianRadialBasis]

    Permalink

    Learns Gaussian RBF function and centers from data.

    Learns Gaussian RBF function and centers from data. The centers are chosen as the centroids of K-Means. The standard deviation (i.e. width) of Gaussian radial basis function is estimated by the p-nearest neighbors (among centers, not all samples) heuristic. A suggested value for p is 2.

    x

    the training dataset.

    centers

    an array to store centers on output. Its length is used as k of k-means.

    p

    the number of nearest neighbors of centers to estimate the width of Gaussian RBF functions.

    returns

    Gaussian RBF functions with parameter learned from data.

  6. def gaussrbf(x: Array[Array[Double]], centers: Array[Array[Double]]): GaussianRadialBasis

    Permalink

    Learns Gaussian RBF function and centers from data.

    Learns Gaussian RBF function and centers from data. The centers are chosen as the centroids of K-Means. Let dmax be the maximum distance between the chosen centers, the standard deviation (i.e. width) of Gaussian radial basis function is dmax / sqrt(2*k), where k is number of centers. This choice would be close to the optimal solution if the data were uniformly distributed in the input space, leading to a uniform distribution of centroids.

    x

    the training dataset.

    centers

    an array to store centers on output. Its length is used as k of k-means.

    returns

    a Gaussian RBF function with parameter learned from data.

  7. lazy val logger: Logger

    Permalink
    Definition Classes
    Logging
  8. def pdist(data: Array[Array[Double]], half: Boolean = true): Array[Array[Double]]

    Permalink

    Returns the pairwise Euclidean distance matrix.

    Returns the pairwise Euclidean distance matrix.

    data

    the data set.

    half

    if true, only the lower half of matrix is allocated to save space.

    returns

    the lower half of proximity matrix.

  9. def proximity[T](data: Array[T], dist: Distance[T], half: Boolean = true): Array[Array[Double]]

    Permalink

    Returns the proximity matrix of a dataset for given distance function.

    Returns the proximity matrix of a dataset for given distance function.

    data

    the data set.

    dist

    the distance function.

    half

    if true, only the lower half of matrix is allocated to save space.

    returns

    the lower half of proximity matrix.

  10. object time

    Permalink

    Measure running time of a function/block

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped