Commits

mitar  committed fd37d2c

Cleaned up tutorial.

  • Participants
  • Parent commits b371ff5

Comments (0)

Files changed (20)

File docs/reference/Makefile

 	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
 
 clean:
-	-rm -rf _* *.html html .doctrees .buildinfo searchindex.js *.epub epub
+	-rm -rf _* *.html html .doctrees .buildinfo searchindex.js *.epub epub rst/_build
 
 epub:
 	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) epub

File docs/reference/README.txt

 The actual documentation is intermixed from docs/reference/rst and documented
 Python modules in orange/Orange. 
 
-Regression testing and scripts are in docs/reference/rst/code. Additional
-files, such as images, are in docs/reference/rst/files.
+Example scripts and datasets are in docs/reference/rst/code. Additional files,
+such as images, are in docs/reference/rst/files.

File docs/reference/rst/Orange.statistics.rst

+.. py:module:: Orange.statistics
+
 ###########################
 Statistics (``statistics``)
 ###########################

File docs/reference/rst/index.rst

-.. test documentation master file, created by
-   sphinx-quickstart on Wed Nov 17 12:52:23 2010.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
 ##########################
 Orange Scripting Reference
 ##########################
 * :ref:`genindex`
 * :ref:`modindex`
 * :ref:`search`
-

File docs/sphinx-ext/themes/orange_theme/static/orange.css

 
 img {
     border: 0;
+	max-width: 100%;
 }
 
 div#sidebarbutton {

File docs/tutorial/Makefile

 	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
 
 clean:
-	-rm -rf _* *.html html .doctrees .buildinfo searchindex.js *.epub epub
+	-rm -rf _* *.html html .doctrees .buildinfo searchindex.js *.epub epub rst/_build
 
 epub:
 	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) epub

File docs/tutorial/rst/association_rules.rst

-.. _assoc1.py: code/assoc1.py
-.. _assoc2.py: code/assoc2.py
-.. _assoc3.py: code/assoc3.py
-.. _imports-85.tab: code/imports-85.tab
-.. _orngAssoc.htm: ../modules/orngAssoc.htm
-
-
 .. index:: association rules
 
 Association rules
 Orange includes an optimized version of the algorithm that works on
 tabular data).  For number of reasons (but mostly for convenience)
 association rules should be constructed and managed through the
-interface provided by `orngAssoc.htm`_.  As implemented in Orange,
+interface provided by :py:mod:`Orange.associate`.  As implemented in Orange,
 association rules construction procedure does not handle continuous
 attributes, so make sure that your data is categorized. Also, class
 variables are treated just like attributes.  For examples in this
-tutorial, we will use data from the data set `imports-85.tab`_, which
+tutorial, we will use data from the data set :download:`imports-85.tab <code/imports-85.tab>`, which
 surveys different types of cars and lists their characteristics. We
 will use only first ten attributes from this data set and categorize
 them so three equally populated intervals will be created for each
 above script and shows how to build a list of association rules which
 will have support of at least 0.4. Next, we select a subset of first
 five rules, print them out, delete first three rules and repeat the
-printout. The script that does this is (part of `assoc1.py`_, uses
-`imports-85.tab`_)::
+printout. The script that does this is (part of :download:`assoc1.py <code/assoc1.py>`, uses
+:download:`imports-85.tab <code/imports-85.tab>`)::
 
    rules = orange.AssociationRulesInducer(data, support=0.4)
    
    requested in our example should be passed as function
    arguments. 
 
-Here goes the code (part of `assoc2.py`_, uses `imports-85.tab`_)::
+Here goes the code (part of :download:`assoc2.py <code/assoc2.py>`, uses :download:`imports-85.tab <code/imports-85.tab>`)::
 
    rules = orange.AssociationRulesInducer(data, support = 0.4)
    
 make a copy of the set of rules, then sort by first support and then
 confidence, and then print out few best rules. We have also lower
 required minimal support, just to see how many rules we obtain in this
-way (`assoc3.py`_, `imports-85.tab`_)::
+way (:download:`assoc3.py <code/assoc3.py>`, :download:`imports-85.tab <code/imports-85.tab>`)::
 
    minSupport = 0.2
    rules = orngAssoc.build(data, minSupport)

File docs/tutorial/rst/basic_exploration.rst

-.. _adult.tab: ../datasets/adult.tab
-.. _adult_sample.tab: ../datasets/adult_sample.tab
-.. _classification.htm: code/classification.htm
-.. _data_characteristics.py: code/data_characteristics.py
-.. _data_characteristics2.py: code/data_characteristics2.py
-.. _data_characteristics3.py: code/data_characteristics3.py
-.. _data_characteristics4.py: code/data_characteristics4.py
-.. _load_data.htm: code/load_data.htm
-.. _regression.htm: code/regression.htm
-.. _report_missing.py: code/report_missing.py
-.. _sample_adult.py: code/sample_adult.py
-
-
 Basic data exploration
 ======================
 
 first use adult data set from UCI ML Repository. The prediction task
 related to this data set is to determine whether a person
 characterized by 14 attributes like education, race, occupation, etc.,
-makes over $50K/year. Because of the original set `adult.tab`_ is
+makes over $50K/year. Because of the original set :download:`adult.tab <code/adult.tab>` is
 rather big (32561 data instances, about 4 MBytes), we will first
 create a smaller sample of about 3% of instances and use it in our
 examples. If you are curious how we do this, here is the code
-(`sample_adult.py`_ )::
+(:download:`sample_adult.py <code/sample_adult.py>`)::
 
    import orange
    data = orange.ExampleTable("adult")
 often number of classes, number of attributes (and of these, how many
 are nominal and continuous), information if data contains missing
 values, and class distribution. Below is the script that does all
-this (`data_characteristics.py`_, `adult_sample.tab`_)::
+this (:download:`data_characteristics.py <code/data_characteristics.py>`, :download:`adult_sample.tab <code/adult_sample.tab>`)::
 
    import orange
    data = orange.ExampleTable("adult_sample")
 If you would like class distributions printed as proportions of
 each class in the data sets, then the last part of the script needs
 to be slightly changed. This time, we have used string formatting
-with print as well (part of `data_characteristics2.py`_)::
+with print as well (part of :download:`data_characteristics2.py <code/data_characteristics2.py>`)::
 
    # obtain class distribution
    c = [0] * len(data.domain.classVar.values)
 data is the distribution of classes for each value of the discrete
 attribute, and means for continuous attribute (we will leave the
 computation of standard deviation and other statistics to you). Let's
-compute means of continuous attributes first (part of `data_characteristics3.py`_)::
+compute means of continuous attributes first (part of :download:`data_characteristics3.py <code/data_characteristics3.py>`)::
 
    print "Continuous attributes:"
    for a in range(len(data.domain.attributes)):
 for each attribute, how many times a specific value was used for each
 class. Instead, we used a build-in method DomainContingency, which
 does just that. All that our script will do is, mainly, to print it
-out in a readable form (part of `data_characteristics3.py`_)::
+out in a readable form (part of :download:`data_characteristics3.py <code/data_characteristics3.py>`)::
 
    print "\nNominal attributes (contingency matrix for classes:", data.domain.classVar.values, ")"
    cont = orange.DomainContingency(data)
 already learned that if a function isSpecial() can be used to
 determine if for specific instances and attribute the value is not
 defined. Let us use this function to compute the proportion of missing
-values per each attribute (`report_missing.py`_, uses `adult_sample.tab`_)::
+values per each attribute (:download:`report_missing.py <code/report_missing.py>`, uses :download:`adult_sample.tab <code/adult_sample.tab>`)::
 
    import orange
    data = orange.ExampleTable("adult_sample")
 holds averages and mean square errors for continuous attributes, value
 frequencies for discrete attributes, and for both number of instances
 where specific attribute has a missing value.  The use of this object
-is exemplified in the following script (data_characteristics4.py`_,
-uses `adult_sample.tab`_)::
+is exemplified in the following script (:download:`data_characteristics4.py <code/data_characteristics4.py>`,
+uses :download:`adult_sample.tab <code/adult_sample.tab>`)::
 
    import orange
    data = orange.ExampleTable("adult_sample")

File docs/tutorial/rst/classification.rst

-.. _classifier.py: code/classifier.py
-.. _classifier2.py: code/classifier2.py
-.. _voting.tab: code/voting.tab
-.. _dot: http://graphviz.org/
-.. _handful.py: code/handful.py
-.. _tree.py: code/tree.py
-
 Classification
 ==============
 
 A substantial part of Orange is devoted to machine learning methods
 for classification, or supervised data mining. These methods start
 from the data that incorporates class-labeled instances, like
-`voting.tab`_::
+:download:`voting.tab <code/voting.tab>`::
 
    >>> data = orange.ExampleTable("voting.tab")
    >>> data[0]
 Let us see how this works in practice. We will
 construct a naive Bayesian classifier from voting data set, and
 will use it to classify the first five instances from this data set
-(`classifier.py`_, uses `voting.tab`_)::
+(:download:`classifier.py <code/classifier.py>`, uses :download:`voting.tab <code/voting.tab>`)::
 
    import orange
    data = orange.ExampleTable("voting")
 to, say, democrat class, we need to call the classifier with
 additional parameter ``orange.GetProbabilities``. Also, note that the
 democrats have a class index 1. We find this out with print
-``data.domain.classVar.values`` (`classifier2.py`_, uses `voting.tab`_)::
+``data.domain.classVar.values`` (:download:`classifier2.py <code/classifier2.py>`, uses :download:`voting.tab <code/voting.tab>`)::
 
    import orange
    data = orange.ExampleTable("voting")
 other objects (for attribute estimation, stopping criterion, etc.),
 a wrapper (module) called ``orngTree`` was build around it to simplify
 the use of classification trees and to assemble the learner with
-some usual (default) components. Here is a script with it (`tree.py`_,
-uses `voting.tab`_)::
+some usual (default) components. Here is a script with it (:download:`tree.py <code/tree.py>`,
+uses :download:`voting.tab <code/voting.tab>`)::
 
    import orange, orngTree
    data = orange.ExampleTable("voting")
 
 .. note:: 
    The script for classification tree is almost the same as the one
-   for naive Bayes (`classifier2.py`_), except that we have imported
+   for naive Bayes (:download:`classifier2.py <code/classifier2.py>`), except that we have imported
    another module (``orngTree``) and used learner
    ``orngTree.TreeLearner`` to build a classifier called ``tree``.
 
 internalNodeShape="ellipse", leafShape="box")``), which was then
 compiled to PNG using program called `dot`_.
 
-.. image:: tree.*
+.. image:: files/tree.png
    :alt: A graphical presentation of a classification tree
 
+.. _dot: http://graphviz.org/
+
 Nearest neighbors and majority classifiers
 ------------------------------------------
 
 The following script takes naive Bayes, classification tree (what we
 have already learned), majority and k-nearest neighbors classifier
 (new ones) and prints prediction for first 10 instances of voting data
-set (`handful.py`_, uses `voting.tab`_)::
+set (:download:`handful.py <code/handful.py>`, uses :download:`voting.tab <code/voting.tab>`)::
 
    import orange, orngTree
    data = orange.ExampleTable("voting")