package util
Utility functions.
- Alphabetic
- By Inheritance
- util
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
gaussrbf[T <: AnyRef](x: Array[T], centers: Array[T], distance: Metric[T], r: Double): Array[GaussianRadialBasis]
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.
-
def
gaussrbf[T <: AnyRef](x: Array[T], centers: Array[T], distance: Metric[T], p: Int): Array[GaussianRadialBasis]
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.
-
def
gaussrbf[T <: AnyRef](x: Array[T], centers: Array[T], distance: Metric[T]): GaussianRadialBasis
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.
-
def
gaussrbf(x: Array[Array[Double]], centers: Array[Array[Double]], r: Double): Array[GaussianRadialBasis]
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.
-
def
gaussrbf(x: Array[Array[Double]], centers: Array[Array[Double]], p: Int): Array[GaussianRadialBasis]
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.
-
def
gaussrbf(x: Array[Array[Double]], centers: Array[Array[Double]]): GaussianRadialBasis
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.
-
lazy val
logger: Logger
- Definition Classes
- Logging
-
def
pdist(data: Array[Array[Double]], half: Boolean = true): Array[Array[Double]]
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.
-
def
proximity[T](data: Array[T], dist: Distance[T], half: Boolean = true): Array[Array[Double]]
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.
-
object
time
Measure running time of a function/block
High level Smile operators in Scala.