Ignore:
Timestamp:
02/07/12 09:11:19 (2 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Children:
9884:52decd2d77eb, 9885:b2b4d2f190ab
Message:

Polished documentation on data.Table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/Orange.data.table.rst

    r9789 r9883  
    3939    .. attribute:: domain 
    4040 
    41         The domain to which the instances correspond. This 
     41        The domain to which the instances belong. This 
    4242        attribute is read-only. 
    4343 
    4444    .. attribute:: owns_instances 
    4545 
    46         ``True``, if the table contains the data instances and ``False`` if 
     46        ``True`` if the table contains the data instances and ``False`` if 
    4747        it contains references to instances owned by another table. 
    4848 
    4949    .. attribute:: owner 
    5050 
    51         The actual owner of the data when ``own_instances`` is ``False``. 
     51        The actual owner of the data when ``own_instances`` is ``False``; 
     52        ``None`` otherwise. 
    5253 
    5354    .. attribute:: version 
     
    7980 
    8081        Read data from the given file. If the name includes the 
    81         extension it must be one of the known file formats (see 
     82        extension, it must be one of the known file formats (see 
    8283        :doc:`/Orange.data.formats`). If no extension is given, the directory 
    8384        is searched for any file with recognized extensions. If the 
     
    112113        Construct a new data table containing the given data 
    113114        instances. These can be given either as another :obj:`Table` 
    114         or as Python list containing instances of 
     115        or as list of instances represented by list of value or as 
    115116        :obj:`Orange.data.Instance`. 
    116117 
    117         If the optional second argument is True, the first argument 
     118        If the optional second argument is ``True``, the first argument 
    118119        must be a :obj:`Table`. The new table will contain references 
    119120        to data stored in the given table. If the second argument is 
    120         omitted or False, data instances are copied. 
     121        omitted or ``False``, data instances are copied. 
    121122 
    122123        :param instances: data instances 
    123124        :type instances: Table or list 
    124         :param references: if True, the new table contains references 
     125        :param references: if ``True``, the new table contains references 
    125126        :type references: bool 
    126127 
     
    129130    .. method:: __init__(domain, instances) 
    130131 
    131         Construct a new data table with a given domain and initialize 
     132        Construct a new data table with the given domain and initialize 
    132133        it with the given instances. Instances can be given as a 
    133134        :obj:`Table` (if domains do not match, they are converted), 
     
    164165        same attribute appears under two id's it will be added 
    165166        twice. If, on the opposite, same id appears two different 
    166         attributes in two tables, this throws an exception. As 
    167         instances are merged, Orange checks the features and meta 
    168         attributes that appear in multiple tables have the same value 
    169         on all. Missing values are allowed. 
     167        attributes in two tables, this raises an exception. As 
     168        instances are merged, exception is raised if a features or 
     169        a meta attribute that appears in multiple tables does not have the 
     170        same value on all of them; the feature is allowed to have a 
     171        missing value on one or more (or all) tables. 
    170172 
    171173        Note that this is not the SQL's join operator as it doesn't 
    172         try to find matches between the tables. 
     174        try to find matches between the tables but instead merges them 
     175        row by row. 
    173176 
    174177        :param tables: tables to be merged into the new table 
     
    238241 
    239242 
    240     .. method:: select(filt[, idx, negate=False]) 
     243    .. method:: select(filter[, idx, negate=False]) 
    241244 
    242245        Return a subset of instances as a new :obj:`Table`. The first 
     
    248251        If the second argument is given, it must be an integer; 
    249252        select will then return the data instances for which the 
    250         corresponding `filt`'s elements match `idx`. 
     253        corresponding `filter`'s elements match `idx`. 
    251254 
    252255        The third argument, `negate`, can only be given as a 
     
    267270        One common use of this method is to split the data into 
    268271        folds. A list for the first argument can be prepared using 
    269         `Orange.core.MakeRandomIndicesCV`. The following example 
     272        `Orange.data.sample.SubsetIndicesCV`. The following example 
    270273        prepares a simple data table and indices for four-fold cross 
    271274        validation, and then selects the training and testing sets for 
     
    309312        Same as :obj:`select`, except that the resulting table 
    310313        contains references to data instances in the original table 
    311         instead of its own copies. 
     314        instead of its own copy of data. 
    312315 
    313316        In most cases, this function is preferred over the former 
    314         since it consumes much less memory. 
     317        since it consumes less memory. 
    315318 
    316319        :param filt: filter list 
     
    325328 
    326329        Same as :obj:`select`, except that it returns a Python list 
    327     with data instances. 
     330        with data instances. 
    328331 
    329332        :param filt: filter list 
     
    338341 
    339342        Return a table with data instances indicated by indices. For 
    340         instance, `data.get_items([0, 1, 9]` returns a table with 
     343        instance, `data.get_items([0, 1, 9])` returns a table with 
    341344        instances with indices 0, 1 and 9. 
    342345 
     
    351354 
    352355         Same as above, except that it returns a table with references 
    353          to data instances instead of copies. This method is normally 
     356         to data instances. This method is usually 
    354357         preferred over the above one. 
    355358 
     
    362365        Return a table with data instances matching the 
    363366        criteria. These can be given in form of keyword arguments or a 
    364         dictionary; with the latter, additional keyword argument negate 
    365         can be given for selection reversal.  
     367        dictionary; with the latter, additional keyword argument ``negate`` 
     368        can be given to reverse the selection. 
    366369 
    367370        Note that method :obj:`filter_ref` is more memory efficient and 
    368371        should be preferred when data is not going to be modified. 
    369372 
    370         For example, young patients from the lenses data set can be 
    371         selected by :: 
     373        Young patients from the lenses data set can be selected by :: 
    372374 
    373375            young = data.filter(age="young") 
     
    384386                                "astigm": "y"}) 
    385387 
    386         Selection can be reversed only with the latter form, by adding 
    387         a keyword argument `negate` with value 1:: 
     388        Selection can be reversed only in the latter form, by adding 
     389        a keyword argument ``negate`` with value 1:: 
    388390 
    389391            young = data.filter({"age": ["young", "presbyopic"],  
     
    414416    .. method:: filter_list(conditions), filter_list(filter) 
    415417 
    416             As above, except that it return a pure Python list with 
     418            As above, except that it returns a pure Python list with 
    417419            data instances. 
    418420 
     
    434436 
    435437            Similar to above, except that the domain is given by a 
    436             list of features. If keep_metas is True, the new data 
     438            list of features. If ``keep_metas`` is ``True``, the new data 
    437439            instances will also have all the meta attributes from the 
    438440            original domain. 
     
    445447 
    446448            Return a CRC32 computed over all discrete and continuous 
    447             features and class attributes of all data instances. Meta 
    448             attributes and features of other types are ignored. 
     449            features and class attributes of all data instances. 
    449450 
    450451            :rtype: int 
     
    452453    .. method:: has_missing_values() 
    453454 
    454             Return True if any of data instances has any missing 
     455            Return ``True`` if any of data instances has any missing 
    455456            values. Meta attributes are not checked. 
    456457 
    457458    .. method:: has_missing_classes() 
    458459 
    459             Return True if any instance has a missing class value. 
     460            Return ``True`` if any instance miss the class value. 
    460461 
    461462    .. method:: random_instance() 
    462463 
    463464            Return a random instance from the 
    464             table. Data table's own :obj:`random_generator` is used, 
     465            table. Data table's :obj:`random_generator` is used, 
    465466            which is initially seeded to 0, so results are 
    466467            deterministic. 
     
    468469    .. method:: remove_duplicates([weightID]) 
    469470 
    470             Remove duplicates of data instances. If weightID is given, 
     471            Remove duplicates of data instances. If ``weightID`` is given, 
    471472            a meta attribute is added which contains the number of 
    472473            instances merged into each new instance. 
     
    501502    .. method:: remove_meta_attribute(id) 
    502503 
    503             Removes a meta attribute from all data instances. 
     504            Remove a meta attribute from all data instances. 
Note: See TracChangeset for help on using the changeset viewer.