本文整理匯總了C#中numl.Math.LinearAlgebra.Vector.Segment方法的典型用法代碼示例。如果您正苦於以下問題:C# Vector.Segment方法的具體用法?C# Vector.Segment怎麽用?C# Vector.Segment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類numl.Math.LinearAlgebra.Vector
的用法示例。
在下文中一共展示了Vector.Segment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SegmentedConditional
/// <summary>
/// Calculates segmented conditional impurity of y | x When stipulating segments (s), X is broken
/// up into s many segments therefore P(X=x_s) becomes a range probability rather than a fixed
/// probability. In essence the average over H(Y|X = x) becomes SUM_s [ p_s * H(Y|X = x_s) ]. The
/// values that were used to do the split are stored in the Splits member.
/// </summary>
/// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
/// <param name="y">Target impurity.</param>
/// <param name="x">Conditioned impurity.</param>
/// <param name="segments">Number of segments over x to condition upon.</param>
/// <returns>Segmented conditional impurity measure.</returns>
public double SegmentedConditional(Vector y, Vector x, int segments)
{
if (x == null && y == null)
throw new InvalidOperationException("x and y do not exist!");
return SegmentedConditional(y, x, x.Segment(segments));
}