Changeset 7615:ffa536a992c6 in orange


Ignore:
Timestamp:
02/07/11 02:18:53 (3 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
ac6f92f86a654014a6b4c6e4df2fabbe5848a556
Message:

Finished documentation for Orange.statistics.distributions - still needs polishing; Few changes to the style

Location:
orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/statistics/distributions.py

    r7614 r7615  
    196196        :type innerVariable: Orange.data.feature.Feature 
    197197         
    198         Construct an instance of ``Contingency``. 
     198        Construct an instance of ``Contingency`` for the given pair of 
     199        variables. 
    199200      
    200201    .. method:: add(outer_value, inner_value[, weight=1]) 
     
    291292 
    292293 
    293 .. class:: Orange.statistics.distribution.ContingencyClass 
    294  
    295     ContingencyAttrClass is derived from ContingencyClass. 
    296     Here, feature is the outer variable (hence variable=outerVariable) 
    297     and class is the inner (classVar=innerVariable), so this form of 
    298     contingency matrix is suitable for computing the conditional probabilities 
    299     of classes given a value of a feature. 
    300  
    301     Calling add_attrclass(v, c) is here equivalent to calling add(v, c). 
    302     In addition to this, the class supports computation of contingency from instances, 
    303     as you have already seen in the example at the top of this page. 
    304  
    305  
    306     .. method:: ContingencyAttrClass(feature, class_attribute) 
    307  
    308         The inherited constructor, which does exactly the same 
    309         as Contingency's constructor. 
    310  
    311     .. method:: ContingencyAttrClass(feaure, class_attribute) 
    312  
    313         The inherited constructor, which does exactly the same 
    314         as Contingency's constructor. 
    315  
    316     .. method::  ContingencyAttrClass(feature, instances[, weightID]) 
    317  
    318         Constructor that constructs the contingency and computes the 
    319         data from the given instances. If these are weighted, the meta 
    320         attribute with instance weights can be specified.      
    321  
    322     .. method:: p_class(attribute_value) 
    323  
    324         Returns the distribution of classes given the attribute_value. 
    325         If the matrix is normalized, this is equivalent to returning 
    326         self[attribute_value]. 
    327         Result is returned as a normalized Distribution. 
    328  
    329     .. method:: p_class(attribute_value, class_value) 
    330  
    331         Returns the conditional probability of class_value given the 
    332         attribute_value. If the matrix is normalized, this is equivalent 
    333         to returning self[attribute_value][class_value]. 
    334  
    335 Don't confuse the order of arguments: feature value is the first, 
    336 class value is the second, just as in add_attrclass. Although in this 
    337 instance counterintuitive (since the returned value represents the conditional 
    338 probability P(class_value|attribute_value), this order is uniform for all 
    339 (applicable) methods of classes derived from ContingencyClass. 
    340  
    341 You have seen this form of matrix used already at the top of the page. 
    342 We shall only explore the new stuff we've learned about it. 
    343  
    344  
    345 .. _distributions-contingency3.py: code/distributions-contingency3.py 
    346  
    347 part of `distributions-contingency3.py`_ (uses monks-1.tab) 
    348  
    349 .. literalinclude:: code/distributions-contingency3.py 
    350     :lines: 1-25 
    351  
    352 The inner and the outer variable and their relations to the class 
    353 and the features are as expected.:: 
    354  
    355     Inner variable:  y 
    356     Outer variable:  e 
    357  
    358     Class variable:  y 
    359     Feature:         e 
    360  
    361 Distributions are normalized and probabilities are elements from the 
    362 normalized distributions. Knowing that the target concept is 
    363 y := (e=1) or (a=b), distributions are as expected: when e equals 1, class 1 
    364 has a 100% probability, while for the rest, probability is one third, which 
    365 agrees with a probability that two three-valued independent features 
    366 have the same value.:: 
    367  
    368     Distributions: 
    369       p(.|1) = <0.000, 1.000> 
    370       p(.|2) = <0.662, 0.338> 
    371       p(.|3) = <0.659, 0.341> 
    372       p(.|4) = <0.669, 0.331> 
    373  
    374     Probabilities of class '1' 
    375       p(1|1) = 1.000 
    376       p(1|2) = 0.338 
    377       p(1|3) = 0.341 
    378       p(1|4) = 0.331 
    379  
    380     Distributions from a matrix computed manually: 
    381       p(.|1) = <0.000, 1.000> 
    382       p(.|2) = <0.662, 0.338> 
    383       p(.|3) = <0.659, 0.341> 
    384       p(.|4) = <0.669, 0.331> 
    385  
    386  
    387 Manual computation using add_attrclass is similar 
    388 (to be precise: exactly the same) as computation using add. 
    389  
    390 .. _distributions-contingency3.py: code/distributions-contingency3.py 
    391  
    392 part of `distributions-contingency3.py`_ (uses monks-1.tab) 
    393  
    394 .. literalinclude:: code/distributions-contingency3.py 
    395     :lines: 27- 
    396  
    397  
    398 .. class:: Orange.statistics.distribution.ContingencyClassAttr 
    399  
    400     ContingencyClassAttr is similar to ContingencyAttrClass except that here 
    401     the class is the outer and the feature the inner variable. 
    402     As a consequence, this form of contingency matrix is suitable 
    403     for computing conditional probabilities of feature values given class. 
    404     Constructor and add_attrclass nevertheless get the arguments 
    405     in the same order as for ContingencyAttrClass, that is, 
    406     feaure first, class second. 
    407  
    408  
    409     ..method:: ContingencyClassAttr(attribute, class_attribute) 
    410  
    411         The inherited constructor is exactly the same as Contingency's 
    412         constructor, except that the argument order is reversed 
    413         (in Contingency, the outer attribute is given first, 
    414         while here the first argument, attribute, is the inner attribute). 
    415      
    416     .. method:: ContingencyAttrClass(attribute, examples[, weightID]) 
    417  
    418         Constructs the contingency and computes the data from the given 
    419         examples. If these are weighted, the meta attribute with example 
    420         weights can be specified.  
    421      
     294.. class:: Orange.statistics.distribution.ContingencyVarClass 
     295 
     296    A class derived from :obj:`ContingencyVarClass`, which uses a given feature 
     297    as the :obj:`Contingency.outerVariable` and class as the 
     298    :obj:`Contingency.innerVariable` to provide a form suitable for computation 
     299    of conditional class probabilities given the variable value. 
     300     
     301    Calling :obj:`ContingencyVarClass.add_attrclass(v, c)` is equivalent 
     302    to calling :obj:`Contingency.add(v, c)`. Similar as :obj:`Contingency`, 
     303    :obj:`ContingencyVarClass` can compute contingency from instances. 
     304 
     305    .. method:: __init__(feature, class_attribute) 
     306 
     307        :param outerVariable: Descriptor of the outer variable 
     308        :type outerVariable: Orange.data.feature.Feature 
     309        :param outerVariable: Descriptor of the inner variable 
     310        :type innerVariable: Orange.data.feature.Feature 
     311         
     312        Construct an instance of :obj:`ContingencyVarClass` for the given pair of 
     313        variables. Inherited from :obj:`Contingency`. 
     314 
     315    .. method:: __init__(feature, data[, weightId]) 
     316 
     317        :param feature: Descriptor of the outer variable 
     318        :type feature: Orange.data.feature.Feature 
     319        :param data: A set of instances 
     320        :type data: Orange.data.Table 
     321        :param weightId: meta attribute with weights of instances 
     322        :type weightId: int 
     323 
     324        Compute the contingency from the given instances.      
     325 
     326    .. method:: p_class(value) 
     327 
     328        :param value: The value of the variable 
     329        :type value: int, float, string or :obj:`Orange.data.Value` 
     330 
     331        Return the probability distribution of classes given the value of the 
     332        variable. Equivalent to `self[value]`, except for normalization. 
     333 
     334    .. method:: p_class(value, class_value) 
     335 
     336        :param value: The value of the variable 
     337        :type value: int, float, string or :obj:`Orange.data.Value` 
     338        :param class_value: The class value 
     339        :type value: int, float, string or :obj:`Orange.data.Value` 
     340 
     341        Returns the conditional probability of the class_value given the 
     342        feature value, p(class_value|value) (note the order of arguments!) 
     343        Equivalent to `self[values][class_value]`, except for normalization. 
     344         
     345    .. _distributions-contingency3.py: code/distributions-contingency3.py 
     346 
     347    part of `distributions-contingency3.py`_ (uses monks-1.tab) 
     348 
     349    .. literalinclude:: code/distributions-contingency3.py 
     350        :lines: 1-25 
     351 
     352    The inner and the outer variable and their relations to the class are 
     353    as follows:: 
     354 
     355        Inner variable:  y 
     356        Outer variable:  e 
     357     
     358        Class variable:  y 
     359        Feature:         e 
     360 
     361    Distributions are normalized and probabilities are elements from the 
     362    normalized distributions. Knowing that the target concept is 
     363    y := (e=1) or (a=b), distributions are as expected: when e equals 1, class 1 
     364    has a 100% probability, while for the rest, probability is one third, which 
     365    agrees with a probability that two three-valued independent features 
     366    have the same value. :: 
     367 
     368        Distributions: 
     369          p(.|1) = <0.000, 1.000> 
     370          p(.|2) = <0.662, 0.338> 
     371          p(.|3) = <0.659, 0.341> 
     372          p(.|4) = <0.669, 0.331> 
     373     
     374        Probabilities of class '1' 
     375          p(1|1) = 1.000 
     376          p(1|2) = 0.338 
     377          p(1|3) = 0.341 
     378          p(1|4) = 0.331 
     379     
     380        Distributions from a matrix computed manually: 
     381          p(.|1) = <0.000, 1.000> 
     382          p(.|2) = <0.662, 0.338> 
     383          p(.|3) = <0.659, 0.341> 
     384          p(.|4) = <0.669, 0.331> 
     385 
     386 
     387.. class:: Orange.statistics.distribution.ContingencyClassVar 
     388 
     389    :obj:`ContingencyClassVar` is similar to :obj:`ContingencyVarClass` except 
     390    that here the class is outside and the variable is inside. This form of 
     391    contingency matrix is suitable for computing conditional probabilities of 
     392    variable given the class. All methods get the two arguments in the same 
     393    order as in :obj:`ContingencyVarClass`. 
     394 
     395    .. method:: __init__(feature, class_attribute) 
     396 
     397        :param outerVariable: Descriptor of the outer variable 
     398        :type outerVariable: Orange.data.feature.Feature 
     399        :param outerVariable: Descriptor of the inner variable 
     400        :type innerVariable: Orange.data.feature.Feature 
     401         
     402        Construct an instance of :obj:`ContingencyVarClass` for the given pair of 
     403        variables. Inherited from :obj:`Contingency`, except for the reversed 
     404        order. 
     405 
     406    .. method:: __init__(feature, instances[, weightId]) 
     407 
     408        :param feature: Descriptor of the outer variable 
     409        :type feature: Orange.data.feature.Feature 
     410        :param data: A set of instances 
     411        :type data: Orange.data.Table 
     412        :param weightId: meta attribute with weights of instances 
     413        :type weightId: int 
     414 
     415        Compute the contingency from the given instances.      
     416 
    422417    .. method:: p_attr(class_value) 
    423418 
    424         Returns the distribution of attribute values given the class_value. 
    425         If the matrix is normalized, this is equivalent to returning 
    426         self[class_value]. Result is returned as a normalized Distribution. 
    427  
    428     .. method:: p_attr(attribute_value, class_value) 
    429      
    430         Returns the conditional probability of attribute_value given the 
    431         class_value. If the matrix is normalized, this is equivalent to 
    432         returning self[class_value][attribute_value]. 
    433    
    434 As you can see, the class is rather similar to ContingencyAttrClass, 
    435 except that it has p_attr instead of p_class. 
    436 If you, for instance, take the above script and replace the class name, 
    437 the first bunch of prints print out 
    438  
    439  
    440 .. _distributions-contingency4.py: code/distributions-contingency4.py 
    441  
    442 part of the output from `distributions-contingency4.py`_ (uses monk1.tab) 
    443  
    444 The inner and the outer variable and their relations to the class 
    445 and the features are as expected.:: 
    446  
    447     Inner variable:  e 
    448     Outer variable:  y 
    449  
    450     Class variable:  y 
    451     Feature:         e 
    452  
    453  
    454 This is exactly the reverse of the printout from ContingencyAttrClass. 
    455 To print out the distributions, the only difference now is that you need 
    456 to iterate through values of the class attribute and call p_attr. For instance, 
    457  
    458 part of `distributions-contingency4.py`_ (uses monks-1.tab) 
    459  
    460 .. literalinclude:: code/distributions-contingency4.py 
    461     :lines: 31- 
    462  
    463 will print:: 
    464     p(.|0) = <0.000, 0.333, 0.333, 0.333> 
    465     p(.|1) = <0.500, 0.167, 0.167, 0.167> 
    466  
    467  
    468 If the class value is '0', then attribute e cannot be '1' (the first value), 
    469 but can be anything else, with equal probabilities of 0.333. 
    470 If the class value is '1', e is '1' in exactly half of examples 
    471 (work-out why this is so); in the remaining cases, 
    472 e is again distributed uniformly. 
    473      
    474  
    475 .. class:: Orange.statistics.distribution.ContingencyAttrAttr 
    476  
    477     ContingencyAttrAttr stores contingency matrices in which none 
    478     of the features is the class. This is rather similar to Contingency, 
    479     except that it has an additional constructor and method for getting 
    480     the conditional probabilities. 
    481  
    482     .. method:: ContingencyAttrAttr(outer_variable, inner_variable) 
    483  
    484         This constructor is exactly the same as that of Contingency. 
    485  
    486     .. method:: ContingencyAttrAttr(outer_variable, inner_variable,  instances[, weightID]) 
    487  
    488         Computes the contingency from the given instances. 
     419        :param class_value: The value of the variable 
     420        :type class_value: int, float, string or :obj:`Orange.data.Value` 
     421 
     422        Return the probability distribution of variable given the class. 
     423        Equivalent to `self[class_value]`, except for normalization. 
     424 
     425    .. method:: p_attr(value, class_value) 
     426 
     427        :param value: The value of the variable 
     428        :type value: int, float, string or :obj:`Orange.data.Value` 
     429        :param class_value: The class value 
     430        :type value: int, float, string or :obj:`Orange.data.Value` 
     431 
     432        Returns the conditional probability of the value given the 
     433        class, p(value|class_value). 
     434        Equivalent to `self[class][value]`, except for normalization. 
     435 
     436    .. _distributions-contingency4.py: code/distributions-contingency4.py 
     437     
     438    part of the output from `distributions-contingency4.py`_ (uses monk1.tab) 
     439     
     440    The inner and the outer variable and their relations to the class 
     441    and the features are exactly the reverse from :obj:`ContingencyClassVar`:: 
     442     
     443        Inner variable:  e 
     444        Outer variable:  y 
     445     
     446        Class variable:  y 
     447        Feature:         e 
     448     
     449    Distributions given the class can be printed out by calling :meth:`p_attr`. 
     450     
     451    part of `distributions-contingency4.py`_ (uses monks-1.tab) 
     452     
     453    .. literalinclude:: code/distributions-contingency4.py 
     454        :lines: 31- 
     455     
     456    will print:: 
     457        p(.|0) = <0.000, 0.333, 0.333, 0.333> 
     458        p(.|1) = <0.500, 0.167, 0.167, 0.167> 
     459     
     460    If the class value is '0', the attribute e cannot be '1' (the first value), 
     461    while distribution across other values is uniform. 
     462    If the class value is '1', e is '1' in exactly half of examples, and 
     463    distribution of other values is again uniform. 
     464 
     465.. class:: Orange.statistics.distribution.ContingencyVarVar 
     466 
     467    Contingency matrices in which none of the variables is the class.  
     468    The class is similar to the parent class :obj:`Contingency`, except for 
     469    an additional constructor and method for getting conditional probabilities. 
     470 
     471    .. method:: ContingencyVarVar(outer_variable, inner_variable) 
     472 
     473        Inherited from :obj:`Contingency`. 
     474 
     475    .. method:: __init__(outer_variable, inner_variable, data[, weightId]) 
     476 
     477        :param outer_variable: Descriptor of the outer variable 
     478        :type outer_variable: Orange.data.feature.Feature 
     479        :param inner_variable: Descriptor of the inner variable 
     480        :type inner_variable: Orange.data.feature.Feature 
     481        :param data: A set of instances 
     482        :type data: Orange.data.Table 
     483        :param weightId: meta attribute with weights of instances 
     484        :type weightId: int 
     485 
     486        Compute the contingency from the given instances. 
    489487 
    490488    .. method:: p_attr(outer_value) 
    491489 
    492         Returns the probability distribution of the inner 
    493         variable given the outer variable. 
     490        Return the probability distribution of the inner 
     491        variable given the outer variable value. 
    494492 
    495493    .. method:: p_attr(outer_value, inner_value) 
    496494 
    497         Returns the conditional probability of the inner_value 
     495        Return the conditional probability of the inner_value 
    498496        given the outer_value. 
    499497 
    500498 
    501 In the following example, we shall use the ContingencyAttrAttr 
    502 on dataset "bridges" to determine which material is used for 
    503 bridges of different lengths. 
    504  
    505  
    506 .. _distributions-contingency5: code/distributions-contingency5.py 
    507  
    508 part of `distributions-contingency5`_ (uses bridges.tab) 
    509  
    510 .. literalinclude:: code/distributions-contingency5.py 
    511     :lines: 1-19 
    512  
    513 The output tells us that short bridges are mostly wooden or iron, 
    514 and the longer (and the most of middle sized) are made from steel.:: 
    515  
    516     SHORT: 
    517        WOOD (56%) 
    518        IRON (44%) 
    519  
    520     MEDIUM: 
    521        WOOD (9%) 
    522        IRON (11%) 
    523        STEEL (79%) 
    524  
    525     LONG: 
    526        STEEL (100%) 
    527  
    528 As all other contingency matrices, this one can also be computed "manually". 
    529  
    530 .. literalinclude:: code/distributions-contingency5.py 
    531     :lines: 20- 
    532  
    533  
    534 ==================================== 
    535 Contingencies with Continuous Values 
    536 ==================================== 
    537  
    538 What happens if one or both features are continuous? 
    539 As first, contingencies can be built for such features as well. 
    540 Just imagine a contingency as a dictionary with features values 
    541 as keys and objects of type Distribution as values. 
    542  
    543 If the outer feature is continuous, you can use either its values 
    544 or ordinary floating point number for indexing. The index must be one 
    545 of the values that do exist in the contingency matrix. 
    546  
    547 The following script will query for a distribution in between 
    548 the first two keys, which triggers an exception. 
    549  
    550  
    551 .. _distributions-contingency6: code/distributions-contingency6.py 
    552  
    553 part of `distributions-contingency6`_ (uses monks-1.tab) 
    554  
    555 .. literalinclude:: code/distributions-contingency6.py 
    556     :lines: 1-5,18,19 
    557  
    558 If you still find such contingencies useful, you need to take care 
    559 about what you pass for indices. Always use the values from keys() 
    560 directly, instead of manually entering the keys' values you see printed. 
    561 If, for instance, you print out the first key, see it's 4.500 and then 
    562 request cont[4.500] this can give an index error due to rounding. 
    563  
    564 Contingencies with continuous inner features are more useful. 
    565 As first, indexing by discrete values is easier than with continuous. 
    566 Secondly, class Distribution covers both, discrete and continuous 
    567 distributions, so even the methods p_class and p_attr will work, 
    568 except they won't return is not the probability but the density 
    569 (interpolated, if necessary). See the page about Distribution 
    570 for more information. 
    571  
    572 For instance, if you build a ContingencyClassAttr on the iris dataset, 
    573 you can enquire about the probability of the sepal length 5.5. 
    574  
    575 .. _distributions-contingency7: code/distributions-contingency7.py 
    576  
    577 part of `distributions-contingency7`_ (uses iris.tab) 
    578  
    579 .. literalinclude:: code/distributions-contingency7.py 
    580  
    581      
    582 The script's output is:: 
     499    The following example investigates which material is used for 
     500    bridges of different lengths. 
     501     
     502    .. _distributions-contingency5: code/distributions-contingency5.py 
     503     
     504    part of `distributions-contingency5`_ (uses bridges.tab) 
     505     
     506    .. literalinclude:: code/distributions-contingency5.py 
     507        :lines: 1-19 
     508 
     509    Short bridges are mostly wooden or iron, 
     510    and the longer (and the most of middle sized) are made from steel:: 
     511     
     512        SHORT: 
     513           WOOD (56%) 
     514           IRON (44%) 
     515     
     516        MEDIUM: 
     517           WOOD (9%) 
     518           IRON (11%) 
     519           STEEL (79%) 
     520     
     521        LONG: 
     522           STEEL (100%) 
     523     
     524    As all other contingency matrices, this one can also be computed "manually". 
     525     
     526    .. literalinclude:: code/distributions-contingency5.py 
     527        :lines: 20- 
     528 
     529 
     530Contingency matrices for continuous variables 
     531--------------------------------------------- 
     532 
     533The described classes can also be used for continuous values. 
     534 
     535If the outer feature is continuous, the index must be one 
     536of the values that do exist in the contingency matrix. Using other values 
     537triggers an exception:: 
     538 
     539    .. _distributions-contingency6: code/distributions-contingency6.py 
     540     
     541    part of `distributions-contingency6`_ (uses monks-1.tab) 
     542     
     543    .. literalinclude:: code/distributions-contingency6.py 
     544        :lines: 1-5,18,19 
     545 
     546Since even rounding is a problem, the keys should generally come from the 
     547contingencies `keys`. 
     548 
     549Contingencies with discrete outer variable continuous inner variables are 
     550more useful, since methods :obj:`ContingencyClassVar.p_class` and  
     551:obj:`ContingencyVarClass.p_attr` use the primitive density estimation 
     552provided by :obj:`Distribution`. 
     553 
     554For example, :obj:`ContingencyClassVar` on the iris dataset, 
     555you can enquire about the probability of the sepal length 5.5:: 
     556 
     557    .. _distributions-contingency7: code/distributions-contingency7.py 
     558     
     559    part of `distributions-contingency7`_ (uses iris.tab) 
     560     
     561    .. literalinclude:: code/distributions-contingency7.py 
     562 
     563The script outputs:: 
    583564 
    584565    Estimated frequencies for e=5.5 
     
    588569 
    589570 
    590 ======================================== 
    591 Computing Contingencies for All Features 
    592 ======================================== 
    593  
    594 Computing contingency matrices requires iteration through instances. 
    595 We often need to compute ContingencyAttrClass or ContingencyClassAttr 
    596 for all features in the dataset and it is obvious that this will be faster 
    597 if we do it for all features at once. That's taken care of 
    598 by class DomainContingency. 
     571Contingency matrices for the entire domain 
     572------------------------------------------ 
    599573 
    600574DomainContingency is basically a list of contingencies, 
    601 either of type ContingencyAttrClass or ContingencyClassAttr, with two 
    602 additional fields and a constructor that computes the contingencies. 
    603  
    604 .. class:: DomainContingency(instances[, weightID][, classIsOuter=0|1]) 
    605  
    606     Constructor needs to be given a list of instances. 
    607     It constructs a list of contingencies; if classIsOuter is 0 (default), 
    608     these will be ContingencyAttrClass, if 1, ContingencyClassAttr are used. 
    609     It then iterates through instances and computes the contingencies. 
     575either :obj:`ContingencyVarClass` or :obj:`ContingencyClassVar`. 
     576 
     577.. class:: DomainContingency 
     578 
     579    .. method:: __init__(data[, weightId=0, classOuter=0|1]) 
     580 
     581        :param data: A set of instances 
     582        :type data: Orange.data.Table 
     583        :param weightId: meta attribute with weights of instances 
     584        :type weightId: int 
     585        :param classOuter: `True`, if class is the outer variable 
     586        :type classOuter: bool 
     587 
     588        Compute a list of contingencies. 
     589 
     590        .. note:: 
     591         
     592            Note that classIsOuter cannot be given as positional argument, 
     593            but needs to be passed by keyword. 
    610594 
    611595    .. attribute:: classIsOuter (read only) 
    612596 
    613         Tells whether the class is the outer or the inner featue. 
    614         Effectively, this tells whether the elements of the list 
    615         are ContingencyAttrClass or ContingencyClassAttr. 
     597        Tells whether the class is the outer or the inner variable. 
    616598 
    617599    .. attribute:: classes 
     
    621603    .. method:: normalize 
    622604 
    623         Calls normalize for each contingency. 
    624  
    625 The following script will print the contingencies for features 
    626 "a", "b" and "e" for the dataset Monk 1. 
    627  
    628 .. _distributions-contingency8: code/distributions-contingency8.py 
    629  
    630 part of `distributions-contingency8`_ (uses monks-1.tab) 
    631  
    632 .. literalinclude:: code/distributions-contingency8.py 
    633     :lines: 1-11 
    634  
    635  
    636 The contingencies in the DomainContingency dc are of type ContingencyAttrClass 
    637 and tell us conditional distributions of classes, given the value of the feature. 
    638 To compute the distribution of feature values given the class, 
    639 one needs to get a list of ContingencyClassAttr. 
    640  
    641 Note that classIsOuter cannot be given as positional argument, 
    642 but needs to be passed by keyword. 
    643  
    644 .. _distributions-contingency8: code/distributions-contingency8.py 
    645  
    646 part of `distributions-contingency8`_ (uses monks-1.tab) 
    647  
    648 .. literalinclude:: code/distributions-contingency8.py 
    649     :lines: 13-  
     605        Call normalize for all contingencies. 
     606 
     607    The following script prints the contingencies for features 
     608    "a", "b" and "e" for the dataset Monk 1. 
     609     
     610    .. _distributions-contingency8: code/distributions-contingency8.py 
     611     
     612    part of `distributions-contingency8`_ (uses monks-1.tab) 
     613     
     614    .. literalinclude:: code/distributions-contingency8.py 
     615        :lines: 1-11 
     616 
     617    Contingencies are of type :obj:`ContingencyVarClass` give 
     618    the conditional distributions of classes, given the value of the variable. 
     619     
     620    .. _distributions-contingency8: code/distributions-contingency8.py 
     621     
     622    part of `distributions-contingency8`_ (uses monks-1.tab) 
     623     
     624    .. literalinclude:: code/distributions-contingency8.py 
     625        :lines: 13-  
    650626 
    651627""" 
  • orange/doc/sphinx-ext/themes/orange_theme/static/orange.css

    r7581 r7615  
    1717    color: black; 
    1818    font-family: Verdana, Arial; 
    19     font-size: 11px; 
     19    font-size: 12px; 
    2020    line-height: 1.5; 
    2121    padding: 0px; 
     
    265265    white-space: nowrap; 
    266266    padding-left: 0px;  
    267     border-bottom: 2px #ffdecb solid; 
     267    border-bottom: 1px #ffdecb solid; 
    268268} 
    269269 
     
    273273 
    274274h1, h2, h3  { 
    275     border-bottom: 2px #ffdecb solid; 
     275    border-bottom: 1px #ffdecb solid; 
    276276} 
    277277tt { 
    278     font-size: inherit; 
     278    font-size: 13px; 
    279279} 
    280280 
    281281tt.descname { 
    282282    margin-bottom: 0px; 
    283     font-size: 12px; 
     283    font-size: 13px; 
    284284} 
    285285 
    286286H1 , div.body h1 { 
    287     font-size: 12px; 
     287    font-size: 13px; 
    288288    font-weight: bold; 
    289     border-bottom: 2px black solid; 
     289    border-bottom: 1px black solid; 
    290290    padding-left: 5px; 
    291291    background-color: #ffdecb; 
     292    margin-left: -5px; 
    292293} 
    293294 
     
    299300    font-weight: bold; 
    300301    font-family: Verdana; 
    301     font-size: 12px; 
     302    font-size: 13px; 
    302303    padding-left: 5px; 
    303     padding-bottom: 2px; 
     304    padding-bottom: 3px; 
    304305/*  width: 204px;*/ 
    305306/*  background-color: #F69810;*/ 
    306     background-color: #e0e0e0; 
     307    background-color: #e8e8e8; 
    307308    height: 16px; 
    308309    vertical-align: middle; 
    309310    white-space: nowrap; 
    310311    /*clear: both;*/ 
    311     border-bottom: 2px black solid; 
    312 } 
    313  
     312    border-bottom: 1px black solid; 
     313    margin-left: -5px; 
     314} 
     315 
     316 
     317h3, div.body h3, 
     318h4, div.body h4 { 
     319    margin-left: -5px; 
     320    padding-left: 5px; 
     321    font-size: 14px; 
     322} 
     323 
     324h3, div.body h3 { 
     325    background-color: #f8f8f8; 
     326} 
    314327 
    315328/*H3 { 
    316329    font-weight: bold; 
    317330    font-family: Verdana; 
    318     font-size: 11px; 
     331    font-size: 13px; 
    319332    white-space: nowrap; 
    320333} 
     
    331344    border-bottom: 2px #fffff solid; 
    332345    font-family: Verdana; 
    333     font-size: 11px; 
     346    font-size: 13px; 
    334347    font-weight: bold; 
    335348    width: 204px; 
     
    339352 
    340353dl.class > dt { 
    341     font-size: 12px; 
     354    font-size: 13px; 
    342355    font-weight: bold; 
    343356    margin-bottom: 10px; 
     
    367380 
    368381dl.class dt > tt.descclassname { 
    369 /*    color: #999;*/ 
     382/*    color: #777;*/ 
    370383    font-weight: normal; 
     384    font-size: 14px; 
    371385} 
    372386 
     
    398412  margin-top: 1em; 
    399413  font-weight: bold; 
    400   font-size: 10px; 
     414  font-size: 11px; 
    401415 } 
    402416 
     
    435449    background-color: #eee; 
    436450    border: 1px solid #ccc; 
     451    padding-bottom: 0px; 
    437452}  
     453 
     454 
    438455/* -- sidebar --------------------------------------------------------------- */ 
    439456 
    440457div.sphinxsidebarwrapper { 
    441458    padding: 0px 0px 0 0px; 
    442     border: 1px solid #ac9; 
     459    border: 1px solid #FFECE3; //#ac9; 
    443460    background-color: #f8f8f8; 
     461    padding-top: 0; 
    444462} 
    445463 
     
    451469 
    452470div.sphinxsidebar { 
    453 /*    position: absolute; 
    454     right: -170px; 
    455     width: 230px;*/ 
     471/*    position: relative; 
     472    top: -30px;*/ 
    456473    font-size: 90%; 
    457474    margin-left: 0; 
     475    margin-top: 0; 
    458476    padding: 10px; 
     477    padding-top: 0; 
     478    padding-right: 0; 
    459479    text-align: left; 
    460480    z-index: 10; 
Note: See TracChangeset for help on using the changeset viewer.