|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.base.node.mine.bayes.naivebayes.datamodel.AttributeModel
org.knime.base.node.mine.bayes.naivebayes.datamodel.ClassAttributeModel
class ClassAttributeModel
This AttributeModel implementation holds the class attribute
information like the number of rows per class value.
| Field Summary | |
|---|---|
(package private) static String |
MODEL_TYPE
The unique type of this model used for saving/loading. |
| Fields inherited from class org.knime.base.node.mine.bayes.naivebayes.datamodel.AttributeModel |
|---|
MODEL_CONTAINS_NO_CLASS_VALUES, MODEL_CONTAINS_NO_RECORDS |
| Constructor Summary | |
|---|---|
ClassAttributeModel(String rowCaption,
boolean skipMissingVals,
int maxNoOfClassVals)
Constructor for class ClassRowValue. |
|
ClassAttributeModel(String attributeName,
int noOfMissingVals,
boolean skipMissingVals,
Config config)
Constructor for class ClassModel. |
|
| Method Summary | |
|---|---|
(package private) void |
addValueInternal(String classValue,
DataCell attrValue)
Adds the given value to the concrete implementation. |
(package private) Collection<String> |
getClassValues()
|
(package private) Class<? extends DataValue> |
getCompatibleType()
|
(package private) String |
getHTMLView(int totalNoOfRecs)
|
(package private) String |
getHTMLViewHeadLine()
|
(package private) Integer |
getNoOfRecs4ClassValue(String classValue)
|
(package private) double |
getProbabilityInternal(String classValue,
DataCell attributeValue,
double laplaceCorrector)
This should also handle missing values. |
(package private) String |
getType()
|
(package private) void |
saveModelInternal(Config config)
|
String |
toString()
|
(package private) void |
validate()
Called after all training rows where added to validate the model. |
| Methods inherited from class org.knime.base.node.mine.bayes.naivebayes.datamodel.AttributeModel |
|---|
addValue, compareTo, createHTMLTable, createTableHeader, getAttributeName, getInvalidCause, getMissingValueHeader, getNoOfMissingVals, getProbability, loadModel, saveModel, setInvalidCause, sortCollection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final String MODEL_TYPE
| Constructor Detail |
|---|
ClassAttributeModel(String rowCaption,
boolean skipMissingVals,
int maxNoOfClassVals)
rowCaption - the row captionskipMissingVals - set to true if the missing values
should be skipped during learning and predictionmaxNoOfClassVals - the maximum supported number of class values
ClassAttributeModel(String attributeName,
int noOfMissingVals,
boolean skipMissingVals,
Config config)
throws InvalidSettingsException
attributeName - the name of the attributenoOfMissingVals - the number of missing valuesskipMissingVals - set to true if the missing values
should be skipped during learning and predictionconfig - the Config object to read from
InvalidSettingsException - if the settings are invalid| Method Detail |
|---|
void saveModelInternal(Config config)
saveModelInternal in class AttributeModelconfig - the config object to save to
void addValueInternal(String classValue,
DataCell attrValue)
throws TooManyValuesException
addValueInternal in class AttributeModelclassValue - the class valueattrValue - the attribute value. Could be a missing value.
TooManyValuesException - if the column contains more unique
values than supported by this attribute model
void validate()
throws InvalidSettingsException
validate in class AttributeModelInvalidSettingsException - if the model isn't validClass<? extends DataValue> getCompatibleType()
getCompatibleType in class AttributeModelDataValue class to check if the rows
are compatibleCollection<String> getClassValues()
getClassValues in class AttributeModelInteger getNoOfRecs4ClassValue(String classValue)
getNoOfRecs4ClassValue in class AttributeModelclassValue - the class value we want the number of records for
null if only missing values where in this row for the
given class value or the class value wasn't found at all
double getProbabilityInternal(String classValue,
DataCell attributeValue,
double laplaceCorrector)
getProbabilityInternal in class AttributeModelclassValue - the class value to calculate the probability forattributeValue - the attribute value to calculate the
probability for. Could be a missing value.laplaceCorrector - the Laplace corrector to use. A value greater 0
overcomes zero counts.
String getType()
getType in class AttributeModelString getHTMLViewHeadLine()
getHTMLViewHeadLine in class AttributeModelString getHTMLView(int totalNoOfRecs)
getHTMLView in class AttributeModeltotalNoOfRecs - the total number of records in the training data
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||