|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.AbstractIOObject
com.rapidminer.operator.ResultObjectAdapter
com.rapidminer.operator.AbstractModel
com.rapidminer.operator.learner.PredictionModel
com.rapidminer.operator.learner.bayes.DistributionModel
com.rapidminer.operator.learner.bayes.KernelDistributionModel
public class KernelDistributionModel
KernelDistributionModel is a model for learners which estimate distributions of attribute values from example sets like NaiveBayes. Predictions are calculated as product of the conditional probabilities for all attributes times the class probability. The basic learning concept is to simply count occurances of classes and attribute values. This means no probabilities are calculated during the learning step. This is only done before output. Optionally, this calculation can apply a Laplace correction which means in particular that zero probabilities are avoided which would hide information in distributions of other attributes.
| Constructor Summary | |
|---|---|
KernelDistributionModel(ExampleSet exampleSet,
boolean laplaceCorrectionEnabled,
int estimationMode,
int bandwidthSelectionMode,
double bandwidth,
int numberOfKernels,
int gridSize)
|
|
| Method Summary | |
|---|---|
void |
finishRendering()
Will be invoked directly after rendering and gives the object the chance to perform some clean-up. |
java.lang.String[] |
getAttributeNames()
|
java.util.Collection<java.lang.Integer> |
getClassIndices()
|
java.lang.String |
getClassName(int index)
|
Distribution |
getDistribution(int classIndex,
int attributeIndex)
|
boolean |
getLaplaceCorrectionEnabled()
|
double |
getLowerBound(int attributeIndex)
|
int |
getNumberOfAttributes()
|
int |
getNumberOfClasses()
|
int |
getRenderHeight(int preferredHeight)
This method return the pixel height the rendering needs |
int |
getRenderWidth(int preferredWidth)
This method returns the pixel width the rendering needs |
double |
getUpperBound(int attributeIndex)
|
java.awt.Component |
getVisualizationComponent(IOContainer container)
Returns a editor pane that displays the ResultObjectAdapter.toResultString() result
encoded as html. |
boolean |
isDiscrete(int attributeIndex)
|
boolean |
isUpdatable()
This default implementation returns false. |
ExampleSet |
performPrediction(ExampleSet exampleSet,
Attribute predictedLabel)
Perform predictions based on the distribution properties. |
void |
prepareRendering()
Will be invoked before rendering and even before render width and height retrieval. |
void |
render(java.awt.Graphics graphics,
int width,
int height)
This method paints the visual representation onto the given graphics |
void |
setLaplaceCorrectionEnabled(boolean laplaceCorrectionEnabled)
|
java.lang.String |
toString()
|
void |
updateModel(ExampleSet exampleSet)
Updates the model by counting the occurances of classes and attribute values in combination with the class values. |
| Methods inherited from class com.rapidminer.operator.learner.PredictionModel |
|---|
apply, checkCompatibility, copyPredictedLabel, createPredictedLabel, getLabel, removePredictedLabel, removePredictedLabel |
| Methods inherited from class com.rapidminer.operator.AbstractModel |
|---|
getExtension, getFileDescription, getName, getResultIcon, getTrainingHeader, setParameter |
| Methods inherited from class com.rapidminer.operator.ResultObjectAdapter |
|---|
addAction, getActions, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString |
| Methods inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.rapidminer.operator.ResultObject |
|---|
getActions, toResultString |
| Methods inherited from interface com.rapidminer.operator.IOObject |
|---|
copy, getLog, getSource, setLoggingHandler, setSource, write |
| Methods inherited from interface com.rapidminer.operator.Saveable |
|---|
isSavable, save |
| Constructor Detail |
|---|
public KernelDistributionModel(ExampleSet exampleSet,
boolean laplaceCorrectionEnabled,
int estimationMode,
int bandwidthSelectionMode,
double bandwidth,
int numberOfKernels,
int gridSize)
| Method Detail |
|---|
public java.lang.String[] getAttributeNames()
getAttributeNames in class DistributionModelpublic int getNumberOfAttributes()
getNumberOfAttributes in class DistributionModelpublic void updateModel(ExampleSet exampleSet)
updateModel in interface ModelupdateModel in class AbstractModel
public ExampleSet performPrediction(ExampleSet exampleSet,
Attribute predictedLabel)
performPrediction in class DistributionModelpublic boolean isUpdatable()
AbstractModelAbstractModel.updateModel(ExampleSet).
isUpdatable in interface ModelisUpdatable in class AbstractModelpublic void setLaplaceCorrectionEnabled(boolean laplaceCorrectionEnabled)
public boolean getLaplaceCorrectionEnabled()
public double getLowerBound(int attributeIndex)
getLowerBound in class DistributionModelpublic double getUpperBound(int attributeIndex)
getUpperBound in class DistributionModelpublic boolean isDiscrete(int attributeIndex)
isDiscrete in class DistributionModelpublic java.util.Collection<java.lang.Integer> getClassIndices()
getClassIndices in class DistributionModelpublic int getNumberOfClasses()
getNumberOfClasses in class DistributionModelpublic java.lang.String getClassName(int index)
getClassName in class DistributionModel
public Distribution getDistribution(int classIndex,
int attributeIndex)
getDistribution in class DistributionModelpublic java.awt.Component getVisualizationComponent(IOContainer container)
ResultObjectAdapterResultObjectAdapter.toResultString() result
encoded as html. Please note that the returned pane is already enclosed
by a scroll pane. If you overwrite this method you should again ensure that
the returned component is scrollable. The given container is totally ignored.
getVisualizationComponent in interface ResultObjectgetVisualizationComponent in class ResultObjectAdapterpublic void prepareRendering()
Renderable
prepareRendering in interface Renderablepublic void finishRendering()
Renderable
finishRendering in interface Renderablepublic int getRenderHeight(int preferredHeight)
Renderable
getRenderHeight in interface RenderablepreferredHeight - tells the renderable of the size it should deliver best
public int getRenderWidth(int preferredWidth)
Renderable
getRenderWidth in interface RenderablepreferredWidth - tells the renderable of the size it should deliver best
public void render(java.awt.Graphics graphics,
int width,
int height)
Renderable
render in interface Renderablegraphics - the graphics to render ontopublic java.lang.String toString()
toString in interface ReadabletoString in class PredictionModel
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||