|
||||||||||
| 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
public abstract class PredictionModel
PredictionModel is the superclass for all objects generated by learners, i.e. it can be used to create a prediction for a given example set.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
AbstractIOObject.InputStreamProvider |
| Constructor Summary | |
|---|---|
protected |
PredictionModel(ExampleSet trainingExampleSet)
Created a new prediction model which was built on the given example set. |
| Method Summary | |
|---|---|
ExampleSet |
apply(ExampleSet exampleSet)
Applies the model by creating a predicted label attribute and setting the predicted label values. |
protected void |
checkCompatibility(ExampleSet exampleSet)
This method is invoked before the model is actually applied. |
static void |
copyPredictedLabel(ExampleSet source,
ExampleSet destination)
Copies the predicted label from the source example set to the destination example set. |
static Attribute |
createPredictedLabel(ExampleSet exampleSet,
Attribute label)
Creates a predicted label for the given example set based on the label attribute defined for this prediction model. |
protected Attribute |
createPredictionAttributes(ExampleSet exampleSet,
Attribute label)
This method creates prediction attributes like the predicted label and confidences if needed. |
Attribute |
getLabel()
Returns the label attribute. |
abstract ExampleSet |
performPrediction(ExampleSet exampleSet,
Attribute predictedLabel)
Subclasses should iterate through the given example set and set the prediction for each example. |
static void |
removePredictedLabel(ExampleSet exampleSet)
Helper method in order to reduce memory consumption. |
static void |
removePredictedLabel(ExampleSet exampleSet,
boolean removePredictionFromTable,
boolean removeConfidencesFromTable)
Helper method in order to lower memory consumption. |
protected boolean |
supportsConfidences(Attribute label)
This method determines if confidence attributes are created depending on the current label. |
java.lang.String |
toString()
|
| Methods inherited from class com.rapidminer.operator.AbstractModel |
|---|
getExtension, getFileDescription, getName, getTrainingHeader, isInTargetEncoding, isUpdatable, setParameter, updateModel |
| Methods inherited from class com.rapidminer.operator.ResultObjectAdapter |
|---|
addAction, getActions, getAnnotations, getResultIcon, log, log, logError, logNote, logWarning, toHTML, toResultString |
| Methods inherited from class com.rapidminer.operator.AbstractIOObject |
|---|
appendOperatorToHistory, copy, getLog, getProcessingHistory, getSource, initWriting, read, read, read, 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, getResultIcon, toResultString |
| Methods inherited from interface com.rapidminer.operator.IOObject |
|---|
appendOperatorToHistory, copy, getAnnotations, getLog, getProcessingHistory, getSource, setLoggingHandler, setSource, write |
| Constructor Detail |
|---|
protected PredictionModel(ExampleSet trainingExampleSet)
HeaderExampleSet
which means that no reference to the data itself is kept but only to the header, i.e.
to the attribute meta descriptions.
| Method Detail |
|---|
public abstract ExampleSet performPrediction(ExampleSet exampleSet,
Attribute predictedLabel)
throws OperatorException
OperatorException
public ExampleSet apply(ExampleSet exampleSet)
throws OperatorException
OperatorExceptionpublic Attribute getLabel()
protected void checkCompatibility(ExampleSet exampleSet)
throws OperatorException
OperatorException
protected Attribute createPredictionAttributes(ExampleSet exampleSet,
Attribute label)
protected boolean supportsConfidences(Attribute label)
public static Attribute createPredictedLabel(ExampleSet exampleSet,
Attribute label)
exampleSet.replaceAttribute(predictedLabel, AttributeFactory.changeValueType(predictedLabel, Ontology.REAL)); .
This might be useful in cases where a crisp nominal prediction should be
replaced by confidence predictions.
public java.lang.String toString()
toString in interface ReadabletoString in class java.lang.Objectpublic static void removePredictedLabel(ExampleSet exampleSet)
public static void removePredictedLabel(ExampleSet exampleSet,
boolean removePredictionFromTable,
boolean removeConfidencesFromTable)
public static void copyPredictedLabel(ExampleSet source,
ExampleSet destination)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||