|
||||||||||
| 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.BitVectorAttributeModel
public class BitVectorAttributeModel
AttributeModel implementation that can handle BitVectorValues.
| 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 | |
|---|---|
BitVectorAttributeModel(String attributeName,
boolean skipMissingVals)
Constructor for class BitVectorAttributeModel. |
|
BitVectorAttributeModel(String attributeName,
boolean skipMissingVals,
int noOfMissingVals,
Config config)
Constructor for class BitVectorAttributeModel. |
|
| 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<BitVectorValue> |
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) int |
getVectorLength()
|
(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 |
|---|
BitVectorAttributeModel(String attributeName,
boolean skipMissingVals)
attributeName - the name of the attributeskipMissingVals - set to true if the missing values
should be skipped during learning and prediction
public BitVectorAttributeModel(String attributeName,
boolean skipMissingVals,
int noOfMissingVals,
Config config)
throws InvalidSettingsException
attributeName - the name of the attributeskipMissingVals - set to true if the missing values
should be skipped during learning and predictionnoOfMissingVals - the number of missing valuesconfig - 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 validate()
throws InvalidSettingsException
validate in class AttributeModelInvalidSettingsException - if the model isn't validString getType()
getType in class AttributeModelClass<BitVectorValue> 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 modelCollection<String> getClassValues()
getClassValues in class AttributeModelint getVectorLength()
Integer 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 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 | |||||||||