ReferenceInstances (original) (raw)
java.lang.Object
- weka.core.Instances
- weka.classifiers.trees.adtree.ReferenceInstances
All Implemented Interfaces:
java.io.Serializable, RevisionHandler
public class ReferenceInstances
extends Instances
Simple class that extends the Instances class making it possible to create subsets of instances that reference their source set. Is used by ADTree to make reweighting of instances easy to manage.
Version: Revision:1.5Revision: 1.5 Revision:1.5
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
See Also:
Serialized Form
Field Summary
* ### Fields inherited from class weka.core.[Instances](../../../../weka/core/Instances.html "class in weka.core") `[ARFF_DATA](../../../../weka/core/Instances.html#ARFF%5FDATA), [ARFF_RELATION](../../../../weka/core/Instances.html#ARFF%5FRELATION), [FILE_EXTENSION](../../../../weka/core/Instances.html#FILE%5FEXTENSION), [SERIALIZED_OBJ_FILE_EXTENSION](../../../../weka/core/Instances.html#SERIALIZED%5FOBJ%5FFILE%5FEXTENSION)`
Constructor Summary
Constructors
Constructor and Description ReferenceInstances(Instances dataset, int capacity) Creates an empty set of instances. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method and Description void addReference(Instance instance) Adds one instance reference to the end of the set. java.lang.String getRevision() Returns the revision string. * ### Methods inherited from class weka.core.[Instances](../../../../weka/core/Instances.html "class in weka.core") `[add](../../../../weka/core/Instances.html#add-weka.core.Instance-), [attribute](../../../../weka/core/Instances.html#attribute-int-), [attribute](../../../../weka/core/Instances.html#attribute-java.lang.String-), [attributeStats](../../../../weka/core/Instances.html#attributeStats-int-), [attributeToDoubleArray](../../../../weka/core/Instances.html#attributeToDoubleArray-int-), [checkForAttributeType](../../../../weka/core/Instances.html#checkForAttributeType-int-), [checkForStringAttributes](../../../../weka/core/Instances.html#checkForStringAttributes--), [checkInstance](../../../../weka/core/Instances.html#checkInstance-weka.core.Instance-), [classAttribute](../../../../weka/core/Instances.html#classAttribute--), [classIndex](../../../../weka/core/Instances.html#classIndex--), [compactify](../../../../weka/core/Instances.html#compactify--), [delete](../../../../weka/core/Instances.html#delete--), [delete](../../../../weka/core/Instances.html#delete-int-), [deleteAttributeAt](../../../../weka/core/Instances.html#deleteAttributeAt-int-), [deleteAttributeType](../../../../weka/core/Instances.html#deleteAttributeType-int-), [deleteStringAttributes](../../../../weka/core/Instances.html#deleteStringAttributes--), [deleteWithMissing](../../../../weka/core/Instances.html#deleteWithMissing-weka.core.Attribute-), [deleteWithMissing](../../../../weka/core/Instances.html#deleteWithMissing-int-), [deleteWithMissingClass](../../../../weka/core/Instances.html#deleteWithMissingClass--), [enumerateAttributes](../../../../weka/core/Instances.html#enumerateAttributes--), [enumerateInstances](../../../../weka/core/Instances.html#enumerateInstances--), [equalHeaders](../../../../weka/core/Instances.html#equalHeaders-weka.core.Instances-), [firstInstance](../../../../weka/core/Instances.html#firstInstance--), [getRandomNumberGenerator](../../../../weka/core/Instances.html#getRandomNumberGenerator-long-), [insertAttributeAt](../../../../weka/core/Instances.html#insertAttributeAt-weka.core.Attribute-int-), [instance](../../../../weka/core/Instances.html#instance-int-), [kthSmallestValue](../../../../weka/core/Instances.html#kthSmallestValue-weka.core.Attribute-int-), [kthSmallestValue](../../../../weka/core/Instances.html#kthSmallestValue-int-int-), [lastInstance](../../../../weka/core/Instances.html#lastInstance--), [main](../../../../weka/core/Instances.html#main-java.lang.String:A-), [meanOrMode](../../../../weka/core/Instances.html#meanOrMode-weka.core.Attribute-), [meanOrMode](../../../../weka/core/Instances.html#meanOrMode-int-), [mergeInstances](../../../../weka/core/Instances.html#mergeInstances-weka.core.Instances-weka.core.Instances-), [numAttributes](../../../../weka/core/Instances.html#numAttributes--), [numClasses](../../../../weka/core/Instances.html#numClasses--), [numDistinctValues](../../../../weka/core/Instances.html#numDistinctValues-weka.core.Attribute-), [numDistinctValues](../../../../weka/core/Instances.html#numDistinctValues-int-), [numInstances](../../../../weka/core/Instances.html#numInstances--), [randomize](../../../../weka/core/Instances.html#randomize-java.util.Random-), [readInstance](../../../../weka/core/Instances.html#readInstance-java.io.Reader-), [relationName](../../../../weka/core/Instances.html#relationName--), [renameAttribute](../../../../weka/core/Instances.html#renameAttribute-weka.core.Attribute-java.lang.String-), [renameAttribute](../../../../weka/core/Instances.html#renameAttribute-int-java.lang.String-), [renameAttributeValue](../../../../weka/core/Instances.html#renameAttributeValue-weka.core.Attribute-java.lang.String-java.lang.String-), [renameAttributeValue](../../../../weka/core/Instances.html#renameAttributeValue-int-int-java.lang.String-), [resample](../../../../weka/core/Instances.html#resample-java.util.Random-), [resampleWithWeights](../../../../weka/core/Instances.html#resampleWithWeights-java.util.Random-), [resampleWithWeights](../../../../weka/core/Instances.html#resampleWithWeights-java.util.Random-boolean:A-), [resampleWithWeights](../../../../weka/core/Instances.html#resampleWithWeights-java.util.Random-double:A-), [resampleWithWeights](../../../../weka/core/Instances.html#resampleWithWeights-java.util.Random-double:A-boolean:A-), [setClass](../../../../weka/core/Instances.html#setClass-weka.core.Attribute-), [setClassIndex](../../../../weka/core/Instances.html#setClassIndex-int-), [setRelationName](../../../../weka/core/Instances.html#setRelationName-java.lang.String-), [sort](../../../../weka/core/Instances.html#sort-weka.core.Attribute-), [sort](../../../../weka/core/Instances.html#sort-int-), [stratify](../../../../weka/core/Instances.html#stratify-int-), [stringFreeStructure](../../../../weka/core/Instances.html#stringFreeStructure--), [sumOfWeights](../../../../weka/core/Instances.html#sumOfWeights--), [swap](../../../../weka/core/Instances.html#swap-int-int-), [test](../../../../weka/core/Instances.html#test-java.lang.String:A-), [testCV](../../../../weka/core/Instances.html#testCV-int-int-), [toString](../../../../weka/core/Instances.html#toString--), [toSummaryString](../../../../weka/core/Instances.html#toSummaryString--), [trainCV](../../../../weka/core/Instances.html#trainCV-int-int-), [trainCV](../../../../weka/core/Instances.html#trainCV-int-int-java.util.Random-), [variance](../../../../weka/core/Instances.html#variance-weka.core.Attribute-), [variance](../../../../weka/core/Instances.html#variance-int-)` * ### Methods inherited from class java.lang.Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
Constructor Detail
* #### ReferenceInstances public ReferenceInstances([Instances](../../../../weka/core/Instances.html "class in weka.core") dataset, int capacity) Creates an empty set of instances. Parameters: `dataset` \- the instances to get the header information from `capacity` \- the initial storage capacity of the set
Method Detail
* #### addReference public final void addReference([Instance](../../../../weka/core/Instance.html "class in weka.core") instance) Adds one instance reference to the end of the set. Does not copy instance before it is added. Increases the size of the dataset if it is not large enough. Does not check if the instance is compatible with the dataset. Parameters: `instance` \- the instance to be added * #### getRevision public java.lang.String getRevision() Returns the revision string. Specified by: `[getRevision](../../../../weka/core/RevisionHandler.html#getRevision--)` in interface `[RevisionHandler](../../../../weka/core/RevisionHandler.html "interface in weka.core")` Overrides: `[getRevision](../../../../weka/core/Instances.html#getRevision--)` in class `[Instances](../../../../weka/core/Instances.html "class in weka.core")` Returns: the revision