Code author: jhkwakkel <j.h.kwakkel (at) tudelft (dot) nl>
This module contains some convenience functions that wrap machine learning algorithms implemented in orange
The current wrappers use default values for the various parameters that can be specified. Follow the provided links to the orange functions that are being wrapped for more details.
build_orange_data() can be used as a starting point if one wants to use other algorithms provided by orange.
Where appropriate, the relevant documentation from orange has been used.
helper function for turning the data from perform_experiments() into a data object that can be used by the various orange functions.
For more details see orange domain
Parameters: |
|
---|
make a random forest using orange
For more details see orange ensemble
Parameters: |
|
---|---|
Return type: | an orange random forest. |
perform feature selection using orange
For more details see orange feature selection and orange measure attribute
the default measure is ReliefF ((MeasureAttribute_relief in Orange).
Parameters: |
|
---|---|
Return type: | sorted list of tuples with uncertainty names and reliefF attribute scores. |
Orange provides other metrics for feature selection
If you want to use any of of these instead of ReliefF, use the code supplied here as a template, but modify the measure. That is replace:
measure = orange.MeasureAttribute_relief(k=k, m=m)
with the measure of choice. See the above provided links for more details.
performs feature selection using random forests in orange.
For more details see orange ensemble
Parameters: |
|
---|---|
Return type: | sorted list of tuples with uncertainty names and importance values. |
make a classification tree using orange
For more details see orange tree
Parameters: |
|
---|---|
Return type: | a classification tree |
in order to print the results one can for example use graphviz.
>>> import orgnTree
>>> tree = tree(input, classify)
>>> orngTree.printDot(tree, r'..\..\models\tree.dot',
leafStr="%V (%M out of %N)")
this generates a .dot file that can be opened and displayed using graphviz. the leafStr keyword argument specifies the format of the string for each leaf. See on this also the more detailed discussion on the orange web site.
At some future state, a convenience function might be added for turning a tree into a networkx graph. However, this is a possible future addition.