C# Class MyMediaLite.DataType.VectorUtils

Tools for vector-like data
显示文件 Open project: zenogantner/MML-KDD

Public Methods

Method Description
EuclideanNorm ( ICollection vector ) : double

Compute the Euclidean norm of a collection of doubles

InitNormal ( IList vector, double mean, double stdev ) : void

Initialize a collection of doubles with values from a normal distribution

L1Norm ( ICollection vector ) : double

Compute the L1 norm of a collection of doubles

ReadVector ( TextReader reader ) : IList

Read a collection of doubles from a TextReader object

WriteVector ( StreamWriter writer, ICollection vector ) : void

Write a collection of doubles to a streamwriter

Method Details

EuclideanNorm() public static method

Compute the Euclidean norm of a collection of doubles
public static EuclideanNorm ( ICollection vector ) : double
vector ICollection the vector to compute the norm for
return double

InitNormal() public static method

Initialize a collection of doubles with values from a normal distribution
public static InitNormal ( IList vector, double mean, double stdev ) : void
vector IList the vector to initialize
mean double the mean of the normal distribution
stdev double the standard deviation of the normal distribution
return void

L1Norm() public static method

Compute the L1 norm of a collection of doubles
public static L1Norm ( ICollection vector ) : double
vector ICollection the vector to compute the norm for
return double

ReadVector() public static method

Read a collection of doubles from a TextReader object
public static ReadVector ( TextReader reader ) : IList
reader System.IO.TextReader the to read from
return IList

WriteVector() public static method

Write a collection of doubles to a streamwriter
public static WriteVector ( StreamWriter writer, ICollection vector ) : void
writer System.IO.StreamWriter a
vector ICollection a collection of double values
return void