本文整理匯總了C#中numl.Math.LinearAlgebra.Vector.GetRandom方法的典型用法代碼示例。如果您正苦於以下問題:C# Vector.GetRandom方法的具體用法?C# Vector.GetRandom怎麽用?C# Vector.GetRandom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類numl.Math.LinearAlgebra.Vector
的用法示例。
在下文中一共展示了Vector.GetRandom方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Generate
/// <summary>Generates.</summary>
/// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
/// <param name="X">The Matrix to process.</param>
/// <param name="y">The Vector to process.</param>
/// <returns>An IModel.</returns>
public override IModel Generate(Matrix X, Vector y)
{
if (Descriptor == null)
throw new InvalidOperationException("Cannot build decision tree without type knowledge!");
this.Preprocess(X);
var tree = new Tree();
//var n = BuildUglyTree(x, y, Depth, new List<int>(x.Cols));
tree.Root = BuildTree(X, y, Depth, new List<int>(X.Cols), tree);
// have to guess something....
// especially when automating
// the thing in a Learner
// this only happens if it is something
// it has never seen.
if (Hint == double.Epsilon)
Hint = y.GetRandom(); // flip a coin...
return new DecisionTreeModel
{
Descriptor = Descriptor,
NormalizeFeatures = NormalizeFeatures,
FeatureNormalizer = FeatureNormalizer,
FeatureProperties = FeatureProperties,
Tree = tree,
Hint = Hint
};
}