本文整理汇总了Java中org.dmg.pmml.OutputField.getRankOrder方法的典型用法代码示例。如果您正苦于以下问题:Java OutputField.getRankOrder方法的具体用法?Java OutputField.getRankOrder怎么用?Java OutputField.getRankOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dmg.pmml.OutputField
的用法示例。
在下文中一共展示了OutputField.getRankOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEntityId
import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
static
private String getEntityId(Object object, OutputField outputField){
HasEntityId hasEntityId = TypeUtil.cast(HasEntityId.class, object);
int rank = outputField.getRank();
if(rank <= 0){
throw new InvalidAttributeException(outputField, PMMLAttributes.OUTPUTFIELD_RANK, rank);
} // End if
if(rank > 1){
HasEntityIdRanking hasEntityIdRanking = TypeUtil.cast(HasEntityIdRanking.class, object);
OutputField.RankOrder rankOrder = outputField.getRankOrder();
switch(rankOrder){
case DESCENDING:
break;
default:
throw new UnsupportedAttributeException(outputField, rankOrder);
}
return getElement(hasEntityIdRanking.getEntityIdRanking(), rank);
}
return hasEntityId.getEntityId();
}
示例2: getAffinity
import org.dmg.pmml.OutputField; //导入方法依赖的package包/类
static
public Double getAffinity(Object object, OutputField outputField){
HasAffinity hasAffinity = TypeUtil.cast(HasAffinity.class, object);
int rank = outputField.getRank();
if(rank <= 0){
throw new InvalidAttributeException(outputField, PMMLAttributes.OUTPUTFIELD_RANK, rank);
} // End if
if(rank > 1){
HasAffinityRanking hasAffinityRanking = TypeUtil.cast(HasAffinityRanking.class, object);
OutputField.RankOrder rankOrder = outputField.getRankOrder();
switch(rankOrder){
case DESCENDING:
break;
default:
throw new UnsupportedAttributeException(outputField, rankOrder);
}
return getElement(hasAffinityRanking.getAffinityRanking(), rank);
}
String value = getCategoryValue(object, outputField);
return hasAffinity.getAffinity(value);
}