source: orange/Orange/testing/regression/tests_20/modules_outlier2.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 568 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

Line 
1# Description: Shows how to use outlier detection
2# Category:    Outlier detection
3# Classes:     orngOutlier
4# Uses:        bridges
5# Referenced:  OutlierDetection.htm
6
7import orange, orngOutlier
8
9data = orange.ExampleTable("bridges")
10outlierDet = orngOutlier.OutlierDetection()
11outlierDet.setExamples(data, orange.ExamplesDistanceConstructor_Euclidean(data))
12outlierDet.setKNN(3)
13zValues = outlierDet.zValues()
14sorted = []
15for el in zValues: sorted.append(el)
16sorted.sort()
17for i, el in enumerate(zValues):
18    if el > sorted[-6]: print  data[i], "Z-score: %5.3f" % el
Note: See TracBrowser for help on using the repository browser.