Вы должны добавить новый мета столбец данных, содержащий веса экземпляра (см Meta attributes и Table.add_meta_attribute. Хранить идентификатор мета столбца и вызовите ученика с этим мета ид.
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)