Changeset 9136:b714663d7f58 in orange
 Timestamp:
 10/21/11 15:43:35 (3 years ago)
 Branch:
 default
 Convert:
 d18ccb99872a8ba91dc5d197c991f60df869ea0b
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

orange/Orange/statistics/contingency.py
r8042 r9136 17 17 The example below loads the monks1 data set and prints out the conditional 18 18 class distribution given the value of `e`. 19 20 .. _statisticscontingency: code/statisticscontingency.py21 22 part of `statisticscontingency`_ (uses monks1.tab)23 19 24 20 .. literalinclude:: code/statisticscontingency.py … … 248 244 :rtype: float 249 245 250 .. _statisticscontingency3.py: code/statisticscontingency3.py251 252 part of `statisticscontingency3.py`_ (uses monks1.tab)253 254 246 .. literalinclude:: code/statisticscontingency3.py 255 247 :lines: 123 … … 339 331 :rtype: float 340 332 341 .. _statisticscontingency4.py: code/statisticscontingency4.py342 343 333 .. literalinclude:: code/statisticscontingency4.py 344 334 :lines: 127 345 335 346 part of the output from `statisticscontingency4.py`_ (uses monk1.tab)347 348 336 The role of the feature and the class are reversed compared to 349 337 :obj:`ClassVar`:: … … 356 344 357 345 Distributions given the class can be printed out by calling :meth:`p_attr`. 358 359 part of `statisticscontingency4.py`_ (uses monks1.tab)360 346 361 347 .. literalinclude:: code/statisticscontingency4.py … … 417 403 bridges of different lengths. 418 404 419 .. _statisticscontingency5.py: code/statisticscontingency5.py420 421 part of `statisticscontingency5.py`_ (uses bridges.tab)422 423 405 .. literalinclude:: code/statisticscontingency5.py 424 406 :lines: 117 … … 483 465 The following script prints the contingency tables for features 484 466 "a", "b" and "e" for the dataset Monk 1. 485 486 .. _statisticscontingency8: code/statisticscontingency8.py 487 488 part of `statisticscontingency8`_ (uses monks1.tab) 489 467 490 468 .. literalinclude:: code/statisticscontingency8.py 491 469 :lines: 9 … … 494 472 the conditional distributions of classes, given the value of the variable. 495 473 496 .. _statisticscontingency8: code/statisticscontingency8.py497 498 part of `statisticscontingency8`_ (uses monks1.tab)499 500 474 .. literalinclude:: code/statisticscontingency8.py 501 475 :lines: 12 502 476 503 504 477 .. _contcont: 505 478 … … 509 482 If the outer variable is continuous, the index must be one of the 510 483 values that do exist in the contingency table; other values raise an 511 exception:: 512 513 .. _statisticscontingency6: code/statisticscontingency6.py 514 515 part of `statisticscontingency6`_ (uses monks1.tab) 516 517 .. literalinclude:: code/statisticscontingency6.py 518 :lines: 14,17 484 exception: 485 486 .. literalinclude:: code/statisticscontingency6.py 487 :lines: 14,17 519 488 520 489 Since even rounding can be a problem, the only safe way to get the key … … 527 496 528 497 For example, :obj:`ClassVar` on the iris dataset can return the 529 probability of the sepal length 5.5 for different classes:: 530 531 .. _statisticscontingency7: code/statisticscontingency7.py 532 533 part of `statisticscontingency7`_ (uses iris.tab) 534 535 .. literalinclude:: code/statisticscontingency7.py 498 probability of the sepal length 5.5 for different classes: 499 500 .. literalinclude:: code/statisticscontingency7.py 536 501 537 502 The script outputs::
Note: See TracChangeset
for help on using the changeset viewer.