source: orange/docs/reference/rst/code/outlier2.py @ 9889:3a754edd2092

Revision 9889:3a754edd2092, 347 bytes checked in by markotoplak, 2 years ago (diff)

Fixed 2.5 examples that used Orange.distance.instances

Line 
1import Orange
2
3bridges = Orange.data.Table("bridges")
4outlier_det = Orange.preprocess.outliers.OutlierDetection()
5outlier_det.set_examples(bridges, Orange.distance.Euclidean(bridges))
6outlier_det.set_knn(3)
7z_values = outlier_det.z_values()
8for ex,zv in sorted(zip(bridges, z_values), key=lambda x: x[1])[-5:]:
9    print ex, "Z-score: %5.3f" % zv
Note: See TracBrowser for help on using the repository browser.