source: orange/docs/reference/rst/code/distance-simple.py @ 9849:4616367a5349

Revision 9849:4616367a5349, 343 bytes checked in by markotoplak, 2 years ago (diff)

Added distance-simple.py.

Line 
1import Orange
2
3data = Orange.data.Table("iris")
4#build a distance with a DistanceConstructor
5measure = Orange.distance.Euclidean(data)
6print "Distance between first two examples:", \
7    measure(data[0], data[1]) #use the Distance
8
9matrix = Orange.distance.distance_matrix(data)
10print "Distance between first two examples:", \
11    matrix[0,1]
Note: See TracBrowser for help on using the repository browser.