|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.mine.decisiontree2.PMMLPredicate
public abstract class PMMLPredicate
Base class for Predicate as specified in PMML (http://www.dmg.org/v4-0/TreeModel.html).
Nested Class Summary | |
---|---|
(package private) static class |
PMMLPredicate.PMMLPredicates
Enumeration of all subclasses of PMMLPredicate. |
Field Summary | |
---|---|
protected static String |
ATTRIBUTE_KEY
The key to store the attribute in configurations. |
protected static String |
CDATA
Constant for CDATA. |
protected static NumberFormat |
NUMBERFORMAT
For formatting the predicates toString output. |
protected static String |
OPERATOR_KEY
The key to store the operator in configurations. |
protected static String |
TYPE_KEY
The key to store the predicate type in configurations. |
Constructor Summary | |
---|---|
PMMLPredicate()
|
Method Summary | |
---|---|
protected void |
cacheSpec(DataTableSpec spec)
Store the spec and index position to speedup subsequent evaluations. |
abstract Boolean |
evaluate(DataRow row,
DataTableSpec spec)
Evaluates the predicate for the passed parameters and returns the result. |
abstract String |
getName()
Returns the name of the predicate. |
PMMLOperator |
getOperator()
|
static PMMLPredicate |
getPredicateForConfig(Config conf)
Returns the correct PMMLPredicate for a config object. |
static PMMLPredicate |
getPredicateForType(String type)
Returns the correct PMMLPredicate for its string representation. |
protected int |
getPreviousIndex()
|
protected DataTableSpec |
getPreviousSpec()
|
protected String |
getSplitAttribute()
Returns the name of the field the predicate operates on, an empty String if it works on multiple attributes, or null if not applicable. |
abstract void |
loadFromPredParams(Config conf)
Load internal predicate settings from a config object. |
abstract void |
saveToPredParams(Config conf)
Save internal predicate settings to a config object. |
void |
setOperator(PMMLOperator op)
|
void |
setOperator(String op)
|
protected void |
setPreviousIndex(int previousIndex)
|
protected void |
setPreviousSpec(DataTableSpec previousSpec)
|
void |
setSplitAttribute(String splitAttribute)
|
abstract String |
toString()
|
abstract void |
writePMML(TransformerHandler handler)
Writes the PMML XML object for the predicate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static NumberFormat NUMBERFORMAT
protected static final String TYPE_KEY
protected static final String ATTRIBUTE_KEY
protected static final String OPERATOR_KEY
protected static final String CDATA
Constructor Detail |
---|
public PMMLPredicate()
Method Detail |
---|
public PMMLOperator getOperator()
public void setOperator(String op)
op
- the op to setpublic void setOperator(PMMLOperator op)
op
- the op to setprotected String getSplitAttribute()
public void setSplitAttribute(String splitAttribute)
splitAttribute
- the splitAttribute to setprotected DataTableSpec getPreviousSpec()
protected void setPreviousSpec(DataTableSpec previousSpec)
previousSpec
- the previousSpec to setprotected int getPreviousIndex()
protected void setPreviousIndex(int previousIndex)
previousIndex
- the previousIndex to setpublic abstract Boolean evaluate(DataRow row, DataTableSpec spec)
row
- The data row containing the data cells to be evaluated.spec
- The spec for the row.
protected void cacheSpec(DataTableSpec spec)
spec
- the spec to be storedpublic abstract String toString()
toString
in class Object
public abstract String getName()
public abstract void writePMML(TransformerHandler handler) throws SAXException
handler
- TransformerHandler for parsing and transforming events
SAXException
- - any SAX exception, possibly wrapping another
exceptionpublic abstract void saveToPredParams(Config conf)
conf
- the config object to write intopublic abstract void loadFromPredParams(Config conf) throws InvalidSettingsException
conf
- the config object to load from
InvalidSettingsException
- - if invalid settings are providedpublic static PMMLPredicate getPredicateForConfig(Config conf) throws InvalidSettingsException
conf
- the config to get a predicate for
InvalidSettingsException
- - if no predicate can be instantiated
with the provided settingspublic static PMMLPredicate getPredicateForType(String type) throws InstantiationException, IllegalAccessException
type
- the string representation of the predicate
InstantiationException
- - if the instantiation fails for some
reason
IllegalAccessException
- - if the class or its nullary constructor
is not accessible.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |