Class MultiLabelBSTreePCT
- java.lang.Object
-
- moa.AbstractMOAObject
-
- moa.options.AbstractOptionHandler
-
- moa.classifiers.rules.multilabel.attributeclassobservers.MultiLabelBSTreePCT
-
- All Implemented Interfaces:
Configurable
,Serializable
,AttributeStatisticsObserver
,NumericStatisticsObserver
,MOAObject
,OptionHandler
public class MultiLabelBSTreePCT extends AbstractOptionHandler implements NumericStatisticsObserver
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
MultiLabelBSTreePCT.Node
-
Field Summary
Fields Modifier and Type Field Description protected DoubleVector[]
leftInputStatistics
protected DoubleVector[]
leftTargetStatistics
protected int
maxNodes
IntOption
maxNodesOption
protected int
numNodes
protected DoubleVector[]
rightInputStatistics
protected DoubleVector[]
rightTargetStatistics
protected MultiLabelBSTreePCT.Node
root
-
Fields inherited from class moa.options.AbstractOptionHandler
config
-
-
Constructor Summary
Constructors Constructor Description MultiLabelBSTreePCT()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeExpansionSuggestion
getBestEvaluatedSplitSuggestion(MultiLabelSplitCriterion criterion, DoubleVector[] preSplitStatistics, int inputAttributeIndex)
Gets the best split suggestion given a criterion and a class distributionAttributeExpansionSuggestion
getBestEvaluatedSplitSuggestion(MultiLabelSplitCriterion criterion, DoubleVector[] preSplitTargetStatistics, DoubleVector[] preSplitInputStatistics, int inputAttributeIndex)
void
getDescription(StringBuilder sb, int indent)
Returns a string representation of this object.String
getPurposeString()
Dictionary with option texts and objectsvoid
observeAttribute(double inputAttributeValue, DoubleVector[] statistics)
Updates statistics of this observer given an attribute value, the index of the statistic and the weight of the instance observedvoid
observeAttribute(double inputAttributeValue, DoubleVector[] targetStatistics, DoubleVector[] inputStatistics)
protected void
prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
This method describes the implementation of how to prepare this object for use.static double
roundToSignificantFigures(double num, int n)
protected AttributeExpansionSuggestion
searchForBestSplitOption(MultiLabelBSTreePCT.Node currentNode, AttributeExpansionSuggestion currentBestOption, MultiLabelSplitCriterion criterion, DoubleVector[] preSplitTargetStatistics, DoubleVector[] preSplitInputStatistics, int inputAttributeIndex)
-
Methods inherited from class moa.options.AbstractOptionHandler
copy, getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
-
Methods inherited from class moa.AbstractMOAObject
copy, measureByteSize, measureByteSize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface moa.MOAObject
measureByteSize
-
Methods inherited from interface moa.options.OptionHandler
copy, getCLICreationString, getOptions, prepareForUse, prepareForUse
-
-
-
-
Field Detail
-
maxNodesOption
public IntOption maxNodesOption
-
maxNodes
protected int maxNodes
-
numNodes
protected int numNodes
-
root
protected MultiLabelBSTreePCT.Node root
-
leftTargetStatistics
protected DoubleVector[] leftTargetStatistics
-
rightTargetStatistics
protected DoubleVector[] rightTargetStatistics
-
leftInputStatistics
protected DoubleVector[] leftInputStatistics
-
rightInputStatistics
protected DoubleVector[] rightInputStatistics
-
-
Method Detail
-
roundToSignificantFigures
public static double roundToSignificantFigures(double num, int n)
-
observeAttribute
public void observeAttribute(double inputAttributeValue, DoubleVector[] statistics)
Description copied from interface:AttributeStatisticsObserver
Updates statistics of this observer given an attribute value, the index of the statistic and the weight of the instance observed- Specified by:
observeAttribute
in interfaceAttributeStatisticsObserver
- Parameters:
inputAttributeValue
- the value for the attribute attributestatistics
- numOutputs x numStatistics the index of the statistic to store
-
observeAttribute
public void observeAttribute(double inputAttributeValue, DoubleVector[] targetStatistics, DoubleVector[] inputStatistics)
-
getBestEvaluatedSplitSuggestion
public AttributeExpansionSuggestion getBestEvaluatedSplitSuggestion(MultiLabelSplitCriterion criterion, DoubleVector[] preSplitStatistics, int inputAttributeIndex)
Description copied from interface:AttributeStatisticsObserver
Gets the best split suggestion given a criterion and a class distribution- Specified by:
getBestEvaluatedSplitSuggestion
in interfaceAttributeStatisticsObserver
- Parameters:
criterion
- the split criterion to usepreSplitStatistics
- the class distribution before the splitinputAttributeIndex
- the input attribute index- Returns:
- suggestion of best attribute split
-
getBestEvaluatedSplitSuggestion
public AttributeExpansionSuggestion getBestEvaluatedSplitSuggestion(MultiLabelSplitCriterion criterion, DoubleVector[] preSplitTargetStatistics, DoubleVector[] preSplitInputStatistics, int inputAttributeIndex)
-
searchForBestSplitOption
protected AttributeExpansionSuggestion searchForBestSplitOption(MultiLabelBSTreePCT.Node currentNode, AttributeExpansionSuggestion currentBestOption, MultiLabelSplitCriterion criterion, DoubleVector[] preSplitTargetStatistics, DoubleVector[] preSplitInputStatistics, int inputAttributeIndex)
-
getPurposeString
public String getPurposeString()
Description copied from class:AbstractOptionHandler
Dictionary with option texts and objects- Specified by:
getPurposeString
in interfaceOptionHandler
- Overrides:
getPurposeString
in classAbstractOptionHandler
- Returns:
- the string with the purpose of this object
-
getDescription
public void getDescription(StringBuilder sb, int indent)
Description copied from interface:MOAObject
Returns a string representation of this object. Used inAbstractMOAObject.toString
to give a string representation of the object.- Specified by:
getDescription
in interfaceMOAObject
- Parameters:
sb
- the stringbuilder to add the descriptionindent
- the number of characters to indent
-
prepareForUseImpl
protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository)
Description copied from class:AbstractOptionHandler
This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implementprepareForUseImpl
and notprepareForUse
sinceprepareForUse
callsprepareForUseImpl
.- Specified by:
prepareForUseImpl
in classAbstractOptionHandler
- Parameters:
monitor
- the TaskMonitor to userepository
- the ObjectRepository to use
-
-