org.android.activityminer.pmml.model.knn
Class NearestNeighborModel

Package class diagram package NearestNeighborModel
java.lang.Object
  extended by org.android.activityminer.pmml.model.knn.NearestNeighborModel
All Implemented Interfaces:
ModelElement

public class NearestNeighborModel
extends Object
implements ModelElement

A simple nearest neighbor model representation (without extensions, model statistics, model explanation, targets, local transformations and model verification elements)


Field Summary
private  String algorithmName
          Can be any string describing the algorithm that was used while creating the k-NN model.
private  CatScoringMethod categoricalScoringMethod
          Specify the scoring (or combining) method for categorical target values of K neighbors
private  ComparisonMeasure comparisonMeasure
          The comparison measure
private  ContScoringMethod continuousScoringMethod
          Specify the scoring (or combining) method for continuous target values of K neighbors
private  MiningFunctionType functionName
          Could be either "classification" or "regression" depending on the target variable(s).
private  String instanceIdVariable
          Contains the instance ID variable name and so refers to the name of a field in InstanceFields.
private  boolean isScorable
          This attribute indicates if the model is valid for scoring.
private  KNNInputs knnInputs
          The knn inputs
private  LocalTransformations localTransformations
          The local transformations
private  MiningSchema miningSchema
          The mining schema
private  String modelName
          A unique identifier specifying the name of the k-NN model
private  int numberOfNeighbors
          instanceFields Specifies K, the number of desired neighbors.
private  Output output
          The output
private  double threshold
          Defines a very small positive number to be used for "weighted" scoring methods to avoid numerical problems when distance or similarity measure is zero.
private  TrainingInstances trainingInstances
          The training instances
 
Constructor Summary
NearestNeighborModel()
           
 
Method Summary
 String getAlgorithmName()
          Getter for the algorithmName
 CatScoringMethod getCategoricalScoringMethod()
          Getter for the categoricalScoringMethod
 ComparisonMeasure getComparisonMeasure()
          Getter for the comparisonMeasure
 ContScoringMethod getContinuousScoringMethod()
          Getter for the continuousScoringMethod
 MiningFunctionType getFunctionName()
          Getter for the functionName
 String getInstanceIdVariable()
          Getter for the instanceIdVariable
 String getIsScorableValue()
          Getter for the isScorable XML attribute value
 KNNInputs getKnnInputs()
          Getter for the knnInputs
 LocalTransformations getLocalTransformations()
          Getter for the localTransformations
 MiningSchema getMiningSchema()
          Getter for the miningSchema
 String getModelName()
          Getter for the modelName
 int getNumberOfNeighbors()
          Getter for the numberOfNeighbors
 Output getOutput()
          Getter for the output
 double getThreshold()
          Getter for the threshold
 TrainingInstances getTrainingInstances()
          Getter for the trainingInstances
 boolean isScorable()
          Getter for the isScorable
 void setAlgorithmName(String algorithmName)
          Setter for the algorithmName
 void setCategoricalScoringMethod(CatScoringMethod categoricalScoringMethod)
          Setter for the categoricalScoringMethod
 void setComparisonMeasure(ComparisonMeasure comparisonMeasure)
          Setter for the comparisonMeasure
 void setContinuousScoringMethod(ContScoringMethod continuousScoringMethod)
          Setter for the continuousScoringMethod
 void setFunctionName(MiningFunctionType functionName)
          Setter for the functionName
 void setInstanceIdVariable(String instanceIdVariable)
          Setter for the instanceIdVariable
 void setIsScorableValue(String isCyclic)
          Setter for the isScorable XML attribute value
 void setKnnInputs(KNNInputs knnInputs)
          Setter for the knnInputs
 void setLocalTransformations(LocalTransformations localTransformations)
          Setter for the localTransformations
 void setMiningSchema(MiningSchema miningSchema)
          Setter for the miningSchema
 void setModelName(String modelName)
          Setter for the modelName
 void setNumberOfNeighbors(int numberOfNeighbors)
          Setter for the numberOfNeighbors
 void setOutput(Output output)
          Setter for the output
 void setScorable(boolean isScorable)
          Setter for the isScorable
 void setThreshold(double threshold)
          Setter for the threshold
 void setTrainingInstances(TrainingInstances trainingInstances)
          Setter for the trainingInstances
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelName

private String modelName
A unique identifier specifying the name of the k-NN model


functionName

private MiningFunctionType functionName
Could be either "classification" or "regression" depending on the target variable(s). If the model contains categorical and continuous targets, this attribute should be "mixed". In case no targets are present then it should be "clustering".


algorithmName

private String algorithmName
Can be any string describing the algorithm that was used while creating the k-NN model.


numberOfNeighbors

private int numberOfNeighbors
instanceFields Specifies K, the number of desired neighbors.


continuousScoringMethod

private ContScoringMethod continuousScoringMethod
Specify the scoring (or combining) method for continuous target values of K neighbors


categoricalScoringMethod

private CatScoringMethod categoricalScoringMethod
Specify the scoring (or combining) method for categorical target values of K neighbors


instanceIdVariable

private String instanceIdVariable
Contains the instance ID variable name and so refers to the name of a field in InstanceFields. Required if the model has no targets, optional otherwise.


threshold

private double threshold
Defines a very small positive number to be used for "weighted" scoring methods to avoid numerical problems when distance or similarity measure is zero.


isScorable

private boolean isScorable
This attribute indicates if the model is valid for scoring. If this attribute is true or if it is missing, then the model should be processed normally. However, if the attribute is false, then the model producer has indicated that this model is intended for information purposes only and should not be used to generate results.


miningSchema

private MiningSchema miningSchema
The mining schema


trainingInstances

private TrainingInstances trainingInstances
The training instances


comparisonMeasure

private ComparisonMeasure comparisonMeasure
The comparison measure


knnInputs

private KNNInputs knnInputs
The knn inputs


output

private Output output
The output


localTransformations

private LocalTransformations localTransformations
The local transformations

Constructor Detail

NearestNeighborModel

public NearestNeighborModel()
Method Detail

setMiningSchema

public void setMiningSchema(MiningSchema miningSchema)
Description copied from interface: ModelElement
Setter for the miningSchema

Specified by:
setMiningSchema in interface ModelElement
Parameters:
miningSchema - the miningSchema to set

getMiningSchema

public MiningSchema getMiningSchema()
Description copied from interface: ModelElement
Getter for the miningSchema

Specified by:
getMiningSchema in interface ModelElement
Returns:
the miningSchema

setModelName

public void setModelName(String modelName)
Setter for the modelName

Parameters:
modelName - the modelName to set

getModelName

public String getModelName()
Getter for the modelName

Returns:
the modelName

setFunctionName

public void setFunctionName(MiningFunctionType functionName)
Setter for the functionName

Parameters:
functionName - the functionName to set

getFunctionName

public MiningFunctionType getFunctionName()
Getter for the functionName

Returns:
the functionName

setAlgorithmName

public void setAlgorithmName(String algorithmName)
Setter for the algorithmName

Parameters:
algorithmName - the algorithmName to set

getAlgorithmName

public String getAlgorithmName()
Getter for the algorithmName

Returns:
the algorithmName

setNumberOfNeighbors

public void setNumberOfNeighbors(int numberOfNeighbors)
Setter for the numberOfNeighbors

Parameters:
numberOfNeighbors - the numberOfNeighbors to set

getNumberOfNeighbors

public int getNumberOfNeighbors()
Getter for the numberOfNeighbors

Returns:
the numberOfNeighbors

setContinuousScoringMethod

public void setContinuousScoringMethod(ContScoringMethod continuousScoringMethod)
Setter for the continuousScoringMethod

Parameters:
continuousScoringMethod - the continuousScoringMethod to set

getContinuousScoringMethod

public ContScoringMethod getContinuousScoringMethod()
Getter for the continuousScoringMethod

Returns:
the continuousScoringMethod

setCategoricalScoringMethod

public void setCategoricalScoringMethod(CatScoringMethod categoricalScoringMethod)
Setter for the categoricalScoringMethod

Parameters:
categoricalScoringMethod - the categoricalScoringMethod to set

getCategoricalScoringMethod

public CatScoringMethod getCategoricalScoringMethod()
Getter for the categoricalScoringMethod

Returns:
the categoricalScoringMethod

getInstanceIdVariable

public String getInstanceIdVariable()
Getter for the instanceIdVariable

Returns:
the instanceIdVariable

getThreshold

public double getThreshold()
Getter for the threshold

Returns:
the threshold

setInstanceIdVariable

public void setInstanceIdVariable(String instanceIdVariable)
Setter for the instanceIdVariable

Parameters:
instanceIdVariable - the instanceIdVariable to set

setThreshold

public void setThreshold(double threshold)
Setter for the threshold

Parameters:
threshold - the threshold to set

setScorable

public void setScorable(boolean isScorable)
Setter for the isScorable

Parameters:
isScorable - the isScorable to set

isScorable

public boolean isScorable()
Getter for the isScorable

Returns:
the isScorable

setIsScorableValue

public void setIsScorableValue(String isCyclic)
Setter for the isScorable XML attribute value

Parameters:
isCyclic - the isScorable XML attribute value to set

getIsScorableValue

public String getIsScorableValue()
Getter for the isScorable XML attribute value

Returns:
the isScorable XML attribute value

setOutput

public void setOutput(Output output)
Description copied from interface: ModelElement
Setter for the output

Specified by:
setOutput in interface ModelElement
Parameters:
output - the output to set

getOutput

public Output getOutput()
Description copied from interface: ModelElement
Getter for the output

Specified by:
getOutput in interface ModelElement
Returns:
the output

setTrainingInstances

public void setTrainingInstances(TrainingInstances trainingInstances)
Setter for the trainingInstances

Parameters:
trainingInstances - the trainingInstances to set

getTrainingInstances

public TrainingInstances getTrainingInstances()
Getter for the trainingInstances

Returns:
the trainingInstances

setComparisonMeasure

public void setComparisonMeasure(ComparisonMeasure comparisonMeasure)
Setter for the comparisonMeasure

Parameters:
comparisonMeasure - the comparisonMeasure to set

getComparisonMeasure

public ComparisonMeasure getComparisonMeasure()
Getter for the comparisonMeasure

Returns:
the comparisonMeasure

setKnnInputs

public void setKnnInputs(KNNInputs knnInputs)
Setter for the knnInputs

Parameters:
knnInputs - the knnInputs to set

getKnnInputs

public KNNInputs getKnnInputs()
Getter for the knnInputs

Returns:
the knnInputs

getLocalTransformations

public LocalTransformations getLocalTransformations()
Getter for the localTransformations

Returns:
the localTransformations

setLocalTransformations

public void setLocalTransformations(LocalTransformations localTransformations)
Setter for the localTransformations

Parameters:
localTransformations - the localTransformations to set