Changeset 7260:eb72b6e79405 in orange


Ignore:
Timestamp:
02/02/11 22:39:18 (3 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
668701f37fcc7d7f1f7ee043320a09e22e140454
Message:
  • added Orange.data.Type
Location:
orange/Orange/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/data/__init__.py

    r7221 r7260  
    33from orange import Value, Domain 
    44 
    5  
     5from orange import VarTypes as Type 
  • orange/Orange/data/feature.py

    r7221 r7260  
     1""" 
     2Data instances in Orange can contain four types of features: `discrete`_, 
     3continuous_, strings_ and Python_; the latter represent arbitrary Python objects. 
     4The names, types, values (where applicable), functions for computing the 
     5feature value from other features, and other properties of the 
     6features are stored in descriptors contained in this module. 
     7 
     8Feature descriptors can be constructed directly, using constructors, or by a 
     9factory function :obj:`make`, which either retrieves an existing descriptor or 
     10constructs a new one. 
     11 
     12.. class:: Feature 
     13 
     14    An abstract base class for feature descriptors. 
     15 
     16    .. attribute:: name 
     17     
     18    Each feature has a name. The names do not need to be unique since two 
     19    features are considered the same only if they have the same descriptor 
     20    (e.g. even multiple features in the same table can have the same name). 
     21    This should however be avoided since it may result in unpredictable 
     22    behaviour. 
     23     
     24    .. attribute:: varType 
     25        
     26    Stores the feature type; it can be Orange.data.Type.Discrete, 
     27    Orange.data.Type.Continuous, Orange.data.Type.String or 
     28    Orange.data.Type.Other.   
     29 
     30    .. attribute:: getValueFrom 
     31    A function (an instance of `Orange.core.Clasifier`) which computes a 
     32    value of the feature from values of one or more other features. This is 
     33    used, for instance, in discretization where the features describing the  
     34    discretized feature are computed from the original feature.  
     35 
     36    .. attribute:: ordered 
     37    A flag telling whether the values of a discrete feature are ordered. At the  
     38    moment, no builtin method treats ordinal features differently than nominal. 
     39     
     40    .. attribute:: distributed 
     41    A flag telling whether the values of this features are distributions. 
     42    As for flag ordered, no methods treat such features in any special manner. 
     43     
     44    .. attribute:: randomGenerator 
     45    A local random number generator used by method :obj:`Feature.randomvalue`. 
     46     
     47    .. attribute:: defaultMetaId 
     48    A proposed (but not guaranteed) meta id to be used for that feature. This is  
     49    used, for instance, by the data loader for tab-delimited file format instead  
     50    of assigning an arbitrary new value, or by `Orange.core.newmetaid` if the 
     51    feature is passed as an argument.  
     52         
     53 
     54    .. method:: __call__(obj) 
     55       Convert a string, number or other suitable object into a feature value. 
     56       :param obj: An object to be converted into a feature value 
     57       :type o: any suitable 
     58       :rtype: :class:`Orange.data.Value` 
     59        
     60    .. method:: randomvalue() 
     61       Return a random value of the feature 
     62       :rtype: :class:`Orange.data.Value` 
     63        
     64    .. method:: computeValue() 
     65       Calls getValueFrom through a mechanism that prevents deadlocks by circular calls. 
     66        
     67""" 
    168from orange import Variable as Feature 
    269from orange import EnumVariable as Discrete 
     
    673 
    774from orange import VarList as Features 
    8 #from orange import VarListList as FeatureListList 
    975 
    10 #from orange import \ 
    11 #         SubsetsGenerator, \ 
    12 #              SubsetsGenerator_constSize, \ 
    13 #              SubsetsGenerator_constant, \ 
    14 #              SubsetsGenerator_minMaxSize, \ 
    15 #              SubsetsGenerator_withRestrictions, \ 
    16 #         SubsetsGenerator_iterator, \ 
    17 #              SubsetsGenerator_constSize_iterator, \ 
    18 #              SubsetsGenerator_constant_iterator, \ 
    19 #              SubsetsGenerator_minMaxSize_iterator, \ 
    20 #              SubsetsGenerator_withRestrictions_iterator 
     76import orange 
     77make = orange.Variable.make 
     78retrieve = orange.Variable.getExisting 
     79del orange 
Note: See TracChangeset for help on using the changeset viewer.