Ignore:
Timestamp:
02/06/12 20:14:37 (2 years ago)
Author:
Miha Stajdohar <miha.stajdohar@…>
Branch:
default
Parents:
9837:0592cf8b6840 (diff), 9827:71697b7e31c7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolved conflicts.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/code/mds-scatterplot.py

    r9827 r9838  
    88 
    99# Load some data 
    10 table = Orange.data.Table("iris.tab") 
     10iris = Orange.data.Table("iris.tab") 
    1111 
    1212# Construct a distance matrix using Euclidean distance 
    13 euclidean = Orange.distance.Euclidean(table) 
    14 distance = Orange.core.SymMatrix(len(table)) 
    15 for i in range(len(table)): 
     13euclidean = Orange.distance.Euclidean(iris) 
     14distance = Orange.core.SymMatrix(len(iris)) 
     15for i in range(len(iris)): 
    1616   for j in range(i + 1): 
    17        distance[i, j] = euclidean(table[i], table[j]) 
     17       distance[i, j] = euclidean(iris[i], iris[j]) 
    1818 
    1919# Run 100 steps of MDS optimization 
     
    2727# Construct points (x, y, instanceClass) 
    2828points = [] 
    29 for (i, d) in enumerate(table): 
     29for (i, d) in enumerate(iris): 
    3030   points.append((mds.points[i][0], mds.points[i][1], d.getclass())) 
    3131 
    3232# Paint each class separately 
    33 for c in range(len(table.domain.class_var.values)): 
     33for c in range(len(iris.domain.class_var.values)): 
    3434    sel = filter(lambda x: x[-1] == c, points) 
    3535    x = [s[0] for s in sel] 
  • docs/reference/rst/code/mds-scatterplot.py

    r9823 r9838  
    1111 
    1212# Construct a distance matrix using Euclidean distance 
    13 euclidean = Orange.distance.instances.EuclideanConstructor(iris) 
     13euclidean = Orange.distance.Euclidean(iris) 
    1414distance = Orange.core.SymMatrix(len(iris)) 
    1515for i in range(len(iris)): 
    16    for j in range(i+1): 
     16   for j in range(i + 1): 
    1717       distance[i, j] = euclidean(iris[i], iris[j]) 
    1818 
Note: See TracChangeset for help on using the changeset viewer.