|
||||||||||
| 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.NominalAttributeModel
class NominalAttributeModel
This AttributeModel implementation calculates the probability for
all nominal attributes.
| 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 | |
|---|---|
NominalAttributeModel(String attributeName,
boolean skipMissingVals,
int maxNoOfNominalVals)
Constructor for class NominalRowValue. |
|
NominalAttributeModel(String attributeName,
int noOfMissingVals,
boolean skipMissingVals,
Config config)
Constructor for class NominalAttributeModel. |
|
| 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<NominalValue> |
getCompatibleType()
|
(package private) String |
getHTMLView(int totalNoOfRecs)
|
(package private) String |
getHTMLViewHeadLine()
|
(package private) int |
getMaxNoOfAttrVals()
|
(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 |
|---|
NominalAttributeModel(String attributeName,
boolean skipMissingVals,
int maxNoOfNominalVals)
attributeName - the name of the attributeskipMissingVals - set to true if the missing values
should be skipped during learning and predictionmaxNoOfNominalVals - the maximum number of nominal values
NominalAttributeModel(String attributeName,
int noOfMissingVals,
boolean skipMissingVals,
Config config)
throws InvalidSettingsException
attributeName - the name of this 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 toint getMaxNoOfAttrVals()
Class<NominalValue> getCompatibleType()
getCompatibleType in class AttributeModelDataValue class to check if the rows
are compatible
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 validCollection<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 getHTMLViewHeadLine()
getHTMLViewHeadLine in class AttributeModelString getType()
getType 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 | |||||||||