0

データ マイニング用の Orange python パッケージは初めてです。私はオレンジ2.7を使用しています。

私のデータセットにはバイナリ ターゲット (良いものと悪いもの) があります。Good インスタンスは、サンプリング ウェイト 10 でダウン サンプリングされます。Orange の Windows バージョンと Linux バージョンの両方で分類分析のためにウェイトを設定して使用するにはどうすればよいですか? ご協力ありがとうございました!

4

1 に答える 1

2

インスタンスの重みを含む新しいメタ列をデータに追加する必要があります (メタ属性Table.add_meta_attributeを参照してください。メタ列の ID を保存し、そのメタ ID で学習者を呼び出します。

import Orange
iris = Orange.data.Table("iris")
# Add some weights to the iris dataset
weight = Orange.feature.Continuous("weight")
weight_id = -10
iris.domain.add_meta(weight_id, weight)
iris.add_meta_attribute(weight, 1.0)
for i in range(50, 150):
     iris[i][weight] = 10

# Train a tree classifier on weighted data.
clsf = Orange.classification.tree.TreeLearner(iris, weight_id)

# Evaluate learner performance on weighted data
results = Orange.evaluation.testing.cross_validation(
    [Orange.classification.tree.TreeLearner,
     Orange.classification.bayes.NaiveLearner],
    (iris, weight_id)  # Note how you pass the weight id to testing functions
)
auc = Orange.evaluation.scoring.AUC(results)
ca = Orange.evaluation.scoring.CA(results)
于 2015-06-01T08:17:21.143 に答える