Median() public static method

Returns a vector of the median values for each row or column.
public static Median ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix Matrix.
t VectorType VectorType.
return Vector
コード例 #1
0
ファイル: Summary.cs プロジェクト: sethjuarez/numl
 /// <summary>
 /// Summarizes a given Matrix.
 /// </summary>
 /// <param name="matrix">Matrix to summarize.</param>
 /// <param name="byVector">Indicates which direction to summarize, default is <see cref="VectorType.Row"/> indicating top-down.</param>
 /// <returns></returns>
 public static Summary Summarize(Matrix matrix, VectorType byVector = VectorType.Row)
 {
     return new Summary()
     {
         Average = matrix.Mean(byVector),
         StandardDeviation = matrix.StdDev(byVector),
         Minimum = matrix.Min(byVector),
         Maximum = matrix.Max(byVector),
         Median = matrix.Median(byVector)
     };
 }
コード例 #2
0
 /// <summary>
 /// Returns a vector of the median values for each row or column.
 /// </summary>
 /// <param name="source"></param>
 /// <param name="t"></param>
 /// <returns></returns>
 public static Vector Median(this Matrix source, VectorType t)
 {
     return(Matrix.Median(source, t));
 }