apriorinode 属性

Apriori 节点图标Apriori节点从数据中提取出一组规则,并提取出信息含量最高的规则。 Apriori 节点提供五种选择规则的方法并使用复杂的索引模式来高效地处理大数据集。 对于较大的问题,Apriori 训练的速度通常较快;它对可保留的规则数量没有任何限制,而且可处理最多带有 32 个前提条件的规则。 Apriori 要求输入和输出字段都是分类字段,但提供更好的性能,因为它针对此类数据进行了优化。

示例

node = stream.create("apriori", "My node")
# "Fields" tab
node.setPropertyValue("custom_fields", True)
node.setPropertyValue("partition", "Test")
# For non-transactional
node.setPropertyValue("use_transactional_data", False)
node.setPropertyValue("consequents", ["Age"])
node.setPropertyValue("antecedents", ["BP", "Cholesterol", "Drug"])
# For transactional
node.setPropertyValue("use_transactional_data", True)
node.setPropertyValue("id_field", "Age")
node.setPropertyValue("contiguous", True)
node.setPropertyValue("content_field", "Drug")
# "Model" tab
node.setPropertyValue("use_model_name", False)
node.setPropertyValue("model_name", "Apriori_bp_choles_drug")
node.setPropertyValue("min_supp", 7.0)
node.setPropertyValue("min_conf", 30.0)
node.setPropertyValue("max_antecedents", 7)
node.setPropertyValue("true_flags", False)
node.setPropertyValue("optimize", "Memory")
# "Expert" tab
node.setPropertyValue("mode", "Expert")
node.setPropertyValue("evaluation", "ConfidenceRatio")
node.setPropertyValue("lower_bound", 7)
表 1。 apriorinode 属性
apriorinode 属性 属性描述
consequents 字段 Apriori模型使用Consequents和Antecedents代替标准的目标和输入字段。 不使用权重字段和频率字段。 请参阅 公共建模节点属性 以获取更多信息。
antecedents [field1 ... fieldN]  
min_supp  
min_conf  
max_antecedents  
true_flags 标志  
optimize Speed
Memory
 
use_transactional_data 标志  
contiguous 标志  
id_field 字符串  
content_field 字符串  
mode Simple Expert  
evaluation RuleConfidence
DifferenceToPrior
ConfidenceRatio
InformationDifference
NormalizedChiSquare
 
lower_bound  
optimize Speed
Memory
用于指定模型构建应针对速度还是内存进行优化。
rules_without_antececents 布尔型 选择允许仅包含结果(项目或项目集)的规则。 当您想确定共同的项目或项目集时,此功能非常有用。 例如, cannedveg 是没有前提条件的单项规则,指示购买 cannedveg 是数据中常见的情况。