source: orange/docs/reference/rst/code/outlier2.py @ 9663:74b63c8ea80c

Revision 9663:74b63c8ea80c, 346 bytes checked in by markotoplak, 2 years ago (diff)

Orange.distance.instances -> Orange.distance

Line 
1import Orange
2
3data = Orange.data.Table("bridges")
4outlier_det = Orange.preprocess.outliers.OutlierDetection()
5outlier_det.set_examples(data, Orange.distance.EuclideanConstructor(data))
6outlier_det.set_knn(3)
7z_values = outlier_det.z_values()
8for ex,zv in sorted(zip(data, 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.