本文整理汇总了C#中Instance.attribute方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.attribute方法的具体用法?C# Instance.attribute怎么用?C# Instance.attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instance
的用法示例。
在下文中一共展示了Instance.attribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: whichSubset
/// <summary> Returns index of subset instance is assigned to.
/// Returns -1 if instance is assigned to more than one subset.
///
/// </summary>
/// <exception cref="Exception">if something goes wrong
/// </exception>
public override int whichSubset(Instance instance)
{
if (instance.isMissing(m_attIndex))
return - 1;
else
{
if (instance.attribute(m_attIndex).Nominal)
{
//UPGRADE_WARNING: Data types in Visual C# might be different. Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
return (int) instance.value_Renamed(m_attIndex);
}
else if (Utils.smOrEq(instance.value_Renamed(m_attIndex), m_splitPoint))
return 0;
else
return 1;
}
}
示例2: whichSubset
/// <summary> Returns the subset an instance falls into.</summary>
private int whichSubset(Instance instance)
{
if (instance.isMissing(m_AttIndex))
{
return 2;
}
else if (instance.attribute(m_AttIndex).Nominal)
{
//UPGRADE_WARNING: Data types in Visual C# might be different. Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
if ((int) instance.value_Renamed(m_AttIndex) == m_SplitPoint)
{
return 0;
}
else
{
return 1;
}
}
else
{
if (instance.value_Renamed(m_AttIndex) <= m_SplitPoint)
{
return 0;
}
else
{
return 1;
}
}
}