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/scoring-diff-measures.py

    r9372 r9823  
    77import Orange 
    88import random 
    9 table = Orange.data.Table("measure") 
     9data = Orange.data.Table("measure") 
    1010 
    11 table2 = Orange.data.Table(table) 
     11data2 = Orange.data.Table(data) 
    1212nulls = [(0, 1, 24, 25), (24, 25), range(24, 34), (24, 25)] 
    1313for attr in range(len(nulls)): 
    1414    for e in nulls[attr]: 
    15         table2[e][attr]="?" 
     15        data2[e][attr]="?" 
    1616 
    17 names = [a.name for a in table.domain.attributes] 
     17names = [a.name for a in data.domain.attributes] 
    1818attrs = len(names) 
    1919print 
     
    2222 
    2323def printVariants(meas): 
    24     print fstr % (("- no unknowns:",) + tuple([meas(i, table) for i in range(attrs)])) 
     24    print fstr % (("- no unknowns:",) + tuple([meas(i, data) for i in range(attrs)])) 
    2525 
    2626    meas.unknowns_treatment = meas.IgnoreUnknowns 
    27     print fstr % (("- ignore unknowns:",) + tuple([meas(i, table2) for i in range(attrs)])) 
     27    print fstr % (("- ignore unknowns:",) + tuple([meas(i, data2) for i in range(attrs)])) 
    2828 
    2929    meas.unknowns_treatment = meas.ReduceByUnknowns 
    30     print fstr % (("- reduce unknowns:",) + tuple([meas(i, table2) for i in range(attrs)])) 
     30    print fstr % (("- reduce unknowns:",) + tuple([meas(i, data2) for i in range(attrs)])) 
    3131 
    3232    meas.unknowns_treatment = meas.UnknownsToCommon 
    33     print fstr % (("- unknowns to common:",) + tuple([meas(i, table2) for i in range(attrs)])) 
     33    print fstr % (("- unknowns to common:",) + tuple([meas(i, data2) for i in range(attrs)])) 
    3434 
    3535    meas.unknowns_treatment = meas.UnknownsAsValue 
    36     print fstr % (("- unknowns as value:",) + tuple([meas(i, table2) for i in range(attrs)])) 
     36    print fstr % (("- unknowns as value:",) + tuple([meas(i, data2) for i in range(attrs)])) 
    3737    print 
    3838 
     
    4848print "Relief" 
    4949meas = Orange.feature.scoring.Relief() 
    50 print fstr % (("- no unknowns:",) + tuple([meas(i, table) for i in range(attrs)])) 
    51 print fstr % (("- with unknowns:",) + tuple([meas(i, table2) for i in range(attrs)])) 
     50print fstr % (("- no unknowns:",) + tuple([meas(i, data) for i in range(attrs)])) 
     51print fstr % (("- with unknowns:",) + tuple([meas(i, data2) for i in range(attrs)])) 
    5252print 
    5353 
Note: See TracChangeset for help on using the changeset viewer.