public class KStar extends AbstractClassifier implements KStarConstants, UpdateableClassifier, TechnicalInformationHandler
@inproceedings{Cleary1995, author = {John G. Cleary and Leonard E. Trigg}, booktitle = {12th International Conference on Machine Learning}, pages = {108-114}, title = {K*: An Instance-based Learner Using an Entropic Distance Measure}, year = {1995} }Valid options are:
-B <num> Manual blend setting (default 20%)
-E Enable entropic auto-blend setting (symbolic class only)
-M <char> Specify the missing value treatment mode (default a) Valid options are: a(verage), d(elete), m(axdiff), n(ormal)
Modifier and Type | Field and Description |
---|---|
static Tag[] |
TAGS_MISSING
Define possible missing value handling methods
|
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
B_ENTROPY, B_SPHERE, EPSILON, FLOOR, FLOOR1, INITIAL_STEP, LOG2, M_AVERAGE, M_DELETE, M_MAXDIFF, M_NORMAL, NUM_RAND_COLS, OFF, ON, ROOT_FINDER_ACCURACY, ROOT_FINDER_MAX_ITER
Constructor and Description |
---|
KStar() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances instances)
Generates the classifier.
|
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance.
|
java.lang.String |
entropicAutoBlendTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getEntropicAutoBlend()
Get whether entropic blending being used
|
int |
getGlobalBlend()
Get the value of the global blend parameter
|
SelectedTag |
getMissingMode()
Gets the method to use for handling missing values.
|
java.lang.String[] |
getOptions()
Gets the current settings of K*.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
java.lang.String |
globalBlendTipText()
Returns the tip text for this property
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
missingModeTipText()
Returns the tip text for this property
|
void |
setEntropicAutoBlend(boolean e)
Set whether entropic blending is to be used.
|
void |
setGlobalBlend(int b)
Set the global blend parameter
|
void |
setMissingMode(SelectedTag newMode)
Sets the method to use for handling missing values.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Returns a description of this classifier.
|
void |
updateClassifier(Instance instance)
Adds the supplied instance to the training set
|
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public static final Tag[] TAGS_MISSING
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in interface Classifier
instances
- set of instances serving as training datajava.lang.Exception
- if the classifier has not been generated successfullypublic void updateClassifier(Instance instance) throws java.lang.Exception
updateClassifier
in interface UpdateableClassifier
instance
- the instance to addjava.lang.Exception
- if instance could not be incorporated successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance to be classifiedjava.lang.Exception
- if an error occurred during the predictionpublic java.lang.String missingModeTipText()
public SelectedTag getMissingMode()
public void setMissingMode(SelectedTag newMode)
newMode
- the method to use for handling missing values.public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class AbstractClassifier
public java.lang.String globalBlendTipText()
public void setGlobalBlend(int b)
b
- the value for global blendingpublic int getGlobalBlend()
public java.lang.String entropicAutoBlendTipText()
public void setEntropicAutoBlend(boolean e)
e
- true if entropic blending is to be usedpublic boolean getEntropicAutoBlend()
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B <num> Manual blend setting (default 20%)
-E Enable entropic auto-blend setting (symbolic class only)
-M <char> Specify the missing value treatment mode (default a) Valid options are: a(verage), d(elete), m(axdiff), n(ormal)
setOptions
in interface OptionHandler
setOptions
in class AbstractClassifier
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class AbstractClassifier
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
argv
- should contain command line options (see setOptions)public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier