public class DecisionTreeFunctionEstimator
extends org.processmining.datadiscovery.estimators.AbstractDecisionTreeFunctionEstimator
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.BiMap<java.lang.Object,java.lang.Integer> |
classIndexMap |
protected com.google.common.collect.BiMap<java.lang.String,java.lang.Object> |
classMapping |
protected java.util.List<java.lang.String> |
classValues |
protected java.lang.Object[] |
outputClasses |
attributeList, binarySplit, booleanValues, classAttributeName, confidenceThreshold, crossValidate, crossValidateRandom, evaluation, FALSE_VALUE, instances, minNumInstancePerLeaf, name, nullValue, numFoldCrossValidation, numFoldErrorPruning, saveData, tree, TRUE_VALUE, unpruned, variableType
Constructor and Description |
---|
DecisionTreeFunctionEstimator(java.util.Map<java.lang.String,org.processmining.datadiscovery.estimators.Type> attributeType,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> literalValues,
java.lang.Object[] outputClasses,
java.lang.String name,
int capacity)
Constructs a new DecisionTreeFunctionEstimator with the place's target
transitions as CLASS value.
|
Modifier and Type | Method and Description |
---|---|
void |
addInstance(java.util.Map<java.lang.String,java.lang.Object> variableAssignment,
java.lang.Object outputValue,
float weight)
Adds a new instance to the estimator's 'instances'.
|
void |
addWekaInstance(weka.core.Instance instance,
java.lang.Object outputValue,
float weight) |
java.lang.Object |
classifyInstance(java.util.Map<java.lang.String,java.lang.Object> attributes) |
double |
computeQualityMeasure()
Evaluates the classification.
|
protected java.util.ArrayList<weka.core.Attribute> |
createAttributeList(java.util.Map<java.lang.String,org.processmining.datadiscovery.estimators.Type> attributeType,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> literalValues,
java.lang.Object[] outputClasses)
Create an
ArrayList with all attributes used (including the class
attribute) |
protected weka.classifiers.AbstractClassifier |
createClassifier(java.lang.Object[] option,
boolean saveData)
Creates the RepTree using the earlier supplied options.
|
weka.classifiers.AbstractClassifier |
getClassifier() |
com.google.common.collect.BiMap<java.lang.Object,java.lang.Integer> |
getClassIndexMap() |
protected java.lang.String |
getClassValue(java.lang.Object outputValue)
Retrieve the classValue from 'mapping' for a given target class (Object)
|
java.util.Map<java.lang.Object,org.processmining.datadiscovery.estimators.FunctionEstimation> |
getFunctionEstimation(java.lang.Object[] option)
Returns a mapping from a Transition
|
Instances |
getInstances() |
boolean |
isTreatNoLeafAsFalse() |
void |
setTreatNoLeafAsFalse(boolean treatNoLeafAsFalse) |
classify, createAndSetTree, createInstance, getAttributeByName, getAttributeIndexMap, getConfidenceThreshold, getCrossValidateRandom, getEvaluation, getMinNumInstancePerLeaf, getName, getNumFoldCrossValidation, getNumFoldErrorPruning, getNumInstances, getPrefuseTreeVisualization, getSumOfWeights, getTreeClassificationAdapter, getVisualization, isBinarySplit, isCrossValidate, isUnpruned, saveInstances, setBinarySplit, setConfidenceFactor, setCrossValidate, setCrossValidateRandom, setMinNumObj, setNumFoldCrossValidation, setNumFolds, setSaveData, setUnpruned, toString
protected final java.lang.Object[] outputClasses
protected java.util.List<java.lang.String> classValues
protected com.google.common.collect.BiMap<java.lang.Object,java.lang.Integer> classIndexMap
protected com.google.common.collect.BiMap<java.lang.String,java.lang.Object> classMapping
public DecisionTreeFunctionEstimator(java.util.Map<java.lang.String,org.processmining.datadiscovery.estimators.Type> attributeType, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> literalValues, java.lang.Object[] outputClasses, java.lang.String name, int capacity)
attributeType
- A Mapping from Attribute name String to Attribute Type (use
AttributeUtil
to create one from a XLog
literalValues
- A Mapping from XAttributeLiteral attribute name String to a
Set of literal values of type String (use
AttributeUtil
to create one from a XLog
outputClasses
- An Object[] array of target CLASS objects.name
- The label of the place associated with this function estimatorcapacity
- parameter for weka 'instances'.protected java.util.ArrayList<weka.core.Attribute> createAttributeList(java.util.Map<java.lang.String,org.processmining.datadiscovery.estimators.Type> attributeType, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> literalValues, java.lang.Object[] outputClasses)
org.processmining.datadiscovery.estimators.AbstractDecisionTreeFunctionEstimator
ArrayList
with all attributes used (including the class
attribute)createAttributeList
in class org.processmining.datadiscovery.estimators.AbstractDecisionTreeFunctionEstimator
public void addInstance(java.util.Map<java.lang.String,java.lang.Object> variableAssignment, java.lang.Object outputValue, float weight)
variableAssignment
- A MapoutputValue
- The Transition which is to be executed with the variable
values of variableAssignment.weight
- Parameter for weighted decision trees. Keep 1 for default.public void addWekaInstance(weka.core.Instance instance, java.lang.Object outputValue, float weight)
protected java.lang.String getClassValue(java.lang.Object outputValue)
outputValue
- A target class (Object)public double computeQualityMeasure()
org.processmining.datadiscovery.estimators.FunctionEstimator
protected weka.classifiers.AbstractClassifier createClassifier(java.lang.Object[] option, boolean saveData) throws java.lang.Exception
createClassifier
in class org.processmining.datadiscovery.estimators.AbstractDecisionTreeFunctionEstimator
option
- Array of Strings containing J48 tree options.saveData
- Boolean. True to enable saving instance data to the tree.java.lang.Exception
- if classifier can't be built correctlypublic java.util.Map<java.lang.Object,org.processmining.datadiscovery.estimators.FunctionEstimation> getFunctionEstimation(java.lang.Object[] option) throws java.lang.Exception
option
- A String[] array of weka J48 tree options. Set to null to
ignore.java.lang.Exception
public java.lang.Object classifyInstance(java.util.Map<java.lang.String,java.lang.Object> attributes) throws java.lang.Exception
attributes
- the instances attribute valuesjava.lang.Exception
public weka.classifiers.AbstractClassifier getClassifier()
public boolean isTreatNoLeafAsFalse()
public void setTreatNoLeafAsFalse(boolean treatNoLeafAsFalse)
public Instances getInstances()
public com.google.common.collect.BiMap<java.lang.Object,java.lang.Integer> getClassIndexMap()