Ignore:
Timestamp:
02/06/12 20:01:02 (2 years ago)
Author:
lanumek
Branch:
default
Children:
9835:e48466fc6eb2, 9841:05a160804431
rebase_source:
8cf30121654f25c9cb6d8ac9bdaf163e305d62da
Message:

Changed names of data sets (table replaced with data or name of the data set).

File:
1 edited

Legend:

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

    r9663 r9823  
    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.EuclideanConstructor(table) 
    14 distance = Orange.core.SymMatrix(len(table)) 
    15 for i in range(len(table)): 
     13euclidean = Orange.distance.instances.EuclideanConstructor(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] 
Note: See TracChangeset for help on using the changeset viewer.