Commits

Miha Stajdohar committed 67f804c

Fixed documentation.

Comments (0)

Files changed (10)

_modelmaps/__init__.py

+"""
+Examples
+========
+
+No examples are implemented yet. Write to the author for more information.
+
+"""
+
 import math
 import os.path
 import pickle
 from model import *
 from modelmap import *
 
+
 #ROOT = "/home/miha/work/res/metamining/"
 #OUT_FILE = ROOT + "dst/zoo"
 #OUT_FILE = ROOT + "dst/zoo"
 #OUT_FILE = ROOT + "_astra_/fprdk"
-
+#
 #def saveSymMatrix(matrix, file, items=None, saveItems=False):
 #    fn = open(file + ".dst", 'w')
 #    fn.write("%d labeled\n" % matrix.dim)
 #    saveSymMatrix(smx, "%s" % fn, smx.items)
 #    smx.items.save('%s.tab' % fn)
 #    pickle.dump(smx.results, open('%s.res' % fn, "wb"))
-
-
-"""
-def evaluateProjections(vizr, attributeList):
-    vizr.evaluatedProjectionsCount = 0
-    vizr.optimizedProjectionsCount = 0
-    vizr.evaluationData = {}            # clear all previous data about tested permutations and stuff
-    vizr.evaluationData["triedCombinations"] = {}
-    vizr.clearResults()
-
-    vizr.clearArguments()
-
-    if vizr.projOptimizationMethod != 0:
-        vizr.freeviz.useGeneralizedEigenvectors = 1
-        vizr.graph.normalizeExamples = 0
-
-    domain = data.Domain([feature.Continuous("xVar"), feature.Continuous("yVar"), feature.Discrete(vizr.graph.dataDomain.classVar.name, values=getVariableValuesSorted(vizr.graph.dataDomain.classVar))])
-    classListFull = vizr.graph.originalData[vizr.graph.dataClassIndex]
-
-    for attributes in attributeList:
-        attrIndices = [vizr.graph.attributeNameIndex[attr] for attr in attributes]
-        #print attrIndices
-        if vizr.projOptimizationMethod != 0:
-            projections = vizr.freeviz.findProjection(vizr.projOptimizationMethod, attrIndices, setAnchors=0, percentDataUsed=vizr.percentDataUsed)
-            if projections != None:
-                xanchors, yanchors, (attrNames, newIndices) = projections
-                table = vizr.graph.createProjectionAsExampleTable(newIndices, domain=domain, XAnchors=xanchors, YAnchors=yanchors)
-
-            if table == None or len(table) < vizr.minNumOfExamples: continue
-            accuracy, other_results = vizr.evaluateProjection(table)
-            generalDict = {"XAnchors": list(xanchors), "YAnchors": list(yanchors), "Results": vizr.evaluationResults} if vizr.saveEvaluationResults else {"XAnchors": list(xanchors), "YAnchors": list(yanchors)}
-            vizr.addResult(accuracy, other_results, len(table), attrNames, vizr.evaluatedProjectionsCount, generalDict=generalDict)
-            vizr.evaluatedProjectionsCount += 1
-        else:
-            XAnchors = vizr.graph.createXAnchors(len(attrIndices))
-            YAnchors = vizr.graph.createYAnchors(len(attrIndices))
-            validData = vizr.graph.getValidList(attrIndices)
-            if numpy.sum(validData) >= vizr.minNumOfExamples:
-                classList = numpy.compress(validData, classListFull)
-                selectedData = numpy.compress(validData, numpy.take(vizr.graph.noJitteringScaledData, attrIndices, axis=0), axis=1)
-                sum_i = vizr.graph._getSum_i(selectedData)
-
-                table = vizr.graph.createProjectionAsExampleTable(attrIndices, validData=validData, classList=classList, sum_i=sum_i, XAnchors=XAnchors, YAnchors=YAnchors, domain=domain)
-                accuracy, other_results = vizr.evaluateProjection(table)
-                generalDict = {"Results": vizr.evaluationResults} if vizr.saveEvaluationResults else {}
-                vizr.addResult(accuracy, other_results, len(table), [vizr.graph.attributeNames[i] for i in attrIndices], vizr.evaluatedProjectionsCount, generalDict)
-                vizr.evaluatedProjectionsCount += 1
-
-    return vizr.evaluatedProjectionsCount
-"""
+#
+#
+#def evaluateProjections(vizr, attributeList):
+#    vizr.evaluatedProjectionsCount = 0
+#    vizr.optimizedProjectionsCount = 0
+#    vizr.evaluationData = {}            # clear all previous data about tested permutations and stuff
+#    vizr.evaluationData["triedCombinations"] = {}
+#    vizr.clearResults()
+#
+#    vizr.clearArguments()
+#
+#    if vizr.projOptimizationMethod != 0:
+#        vizr.freeviz.useGeneralizedEigenvectors = 1
+#        vizr.graph.normalizeExamples = 0
+#
+#    domain = data.Domain([feature.Continuous("xVar"), feature.Continuous("yVar"), feature.Discrete(vizr.graph.dataDomain.classVar.name, values=getVariableValuesSorted(vizr.graph.dataDomain.classVar))])
+#    classListFull = vizr.graph.originalData[vizr.graph.dataClassIndex]
+#
+#    for attributes in attributeList:
+#        attrIndices = [vizr.graph.attributeNameIndex[attr] for attr in attributes]
+#        #print attrIndices
+#        if vizr.projOptimizationMethod != 0:
+#            projections = vizr.freeviz.findProjection(vizr.projOptimizationMethod, attrIndices, setAnchors=0, percentDataUsed=vizr.percentDataUsed)
+#            if projections != None:
+#                xanchors, yanchors, (attrNames, newIndices) = projections
+#                table = vizr.graph.createProjectionAsExampleTable(newIndices, domain=domain, XAnchors=xanchors, YAnchors=yanchors)
+#
+#            if table == None or len(table) < vizr.minNumOfExamples: continue
+#            accuracy, other_results = vizr.evaluateProjection(table)
+#            generalDict = {"XAnchors": list(xanchors), "YAnchors": list(yanchors), "Results": vizr.evaluationResults} if vizr.saveEvaluationResults else {"XAnchors": list(xanchors), "YAnchors": list(yanchors)}
+#            vizr.addResult(accuracy, other_results, len(table), attrNames, vizr.evaluatedProjectionsCount, generalDict=generalDict)
+#            vizr.evaluatedProjectionsCount += 1
+#        else:
+#            XAnchors = vizr.graph.createXAnchors(len(attrIndices))
+#            YAnchors = vizr.graph.createYAnchors(len(attrIndices))
+#            validData = vizr.graph.getValidList(attrIndices)
+#            if numpy.sum(validData) >= vizr.minNumOfExamples:
+#                classList = numpy.compress(validData, classListFull)
+#                selectedData = numpy.compress(validData, numpy.take(vizr.graph.noJitteringScaledData, attrIndices, axis=0), axis=1)
+#                sum_i = vizr.graph._getSum_i(selectedData)
+#
+#                table = vizr.graph.createProjectionAsExampleTable(attrIndices, validData=validData, classList=classList, sum_i=sum_i, XAnchors=XAnchors, YAnchors=YAnchors, domain=domain)
+#                accuracy, other_results = vizr.evaluateProjection(table)
+#                generalDict = {"Results": vizr.evaluationResults} if vizr.saveEvaluationResults else {}
+#                vizr.addResult(accuracy, other_results, len(table), [vizr.graph.attributeNames[i] for i in attrIndices], vizr.evaluatedProjectionsCount, generalDict)
+#                vizr.evaluatedProjectionsCount += 1
+#
+#    return vizr.evaluatedProjectionsCount

_modelmaps/model.py

 Model
 *****
 
-.. autoclass:: mm.Model
+.. autoclass:: Orange.modelmaps.Model
    :members:
 
 """

_modelmaps/modelmap.py

 Build Model Map
 ***************
 
-.. autoclass:: mm.BuildModelMap
+.. autoclass:: Orange.modelmaps.BuildModelMap
    :members:
    
 **************
 Help Functions
 **************
 
+.. autofunction:: load
+.. autofunction:: save
+.. autofunction:: get_models_table
+.. autofunction:: get_feature_subsets
+
 """
 
 import bz2, itertools, math, random, os.path, time, uuid, re, sys

docs/rst/Orange.modelmaps.model.rst

+.. automodule:: Orange.modelmaps.model

docs/rst/Orange.modelmaps.modelmap.rst

+.. automodule:: Orange.modelmaps.modelmap

docs/rst/Orange.modelmaps.rst

+##########################
+Model Maps (``modelmaps``)
+##########################
+
+.. toctree::
+   :maxdepth: 1
+
+   Orange.modelmaps.model
+   Orange.modelmaps.modelmap
+
+.. automodule:: Orange.modelmaps
+

docs/rst/index.rst

-###################
-Model Map Reference
-###################
+Orange Model Maps documentation
+===============================
+
+Orange Model Maps is an add-on for Orange data mining software package. It
+extends Orange by providing modules for building model maps. It also provides
+widgets for Orange Canvas to enable users explore model maps.
+
+.. _Orange: http://orange.biolab.si/addons
+
+
+Scripting Reference
+-------------------
 
 .. toctree::
    :maxdepth: 1
-   
-   mm.model
-   
-   mm.modelmap
 
+   Orange.modelmaps
 
-****************
-Index and search
-****************
+Installation
+------------
+
+To install Model Maps add-on for Orange from PyPi_ run::
+
+    pip install orange-modelmaps
+
+To install it from source code run::
+
+    python setup.py install
+
+To build Python egg run::
+
+    python setup.py bdist_egg
+
+To install add-on in `development mode`_ run::
+
+    python setup.py develop
+
+.. _development mode: http://packages.python.org/distribute/setuptools.html#development-mode
+.. _PyPi: http://pypi.python.org/pypi
+
+Source Code and Issue Tracker
+-----------------------------
+
+Source code is available on Bitbucket_. For issues and wiki we use Trac_.
+
+.. _Bitbucket: https://bitbucket.org/mstajdohar/orange-modelmaps
+.. _Trac: http://orange.biolab.si/trac/
+
+Indices and tables
+==================
 
 * :ref:`genindex`
 * :ref:`modindex`

docs/rst/mm.model.rst

-####################
-model (``mm.model``)
-####################
-
-.. automodule:: mm.model
-   :members:

docs/rst/mm.modelmap.rst

-###########################
-modelmap (``mm.modelmap``)
-###########################
-
-.. automodule:: mm.modelmap
-   :members:

docs/rst/mm.rst

-##################
-Model Map (``mm``)
-##################
-
-.. automodule:: mm.model
-   :members:
-   
-   
-.. automodule:: mm.modelmap
-   :members: