measureattribute1a.py

来自「orange源码 数据挖掘技术」· Python 代码 · 共 18 行

PY
18
字号
# Description: Shows how to assess the quality of attributes not in the dataset
# Category:    attribute quality
# Classes:     EntropyDiscretization, MeasureAttribute, MeasureAttribute_info
# Uses:        iris
# Referenced:  MeasureAttribute.htm

import orange
data = orange.ExampleTable("iris")

d1 = orange.EntropyDiscretization("petal length", data)
print orange.MeasureAttribute_relief(d1, data)

meas = orange.MeasureAttribute_relief()
for t in meas.thresholdFunction("petal length", data):
    print "%5.3f: %5.3f" % t

thresh, score, distr = meas.bestThreshold("petal length", data)
print "\nBest threshold: %5.3f (score %5.3f)" % (thresh, score)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?