weka.core
Class ClassRemoveableInstances
java.lang.Object
weka.core.Instances
weka.core.ClassRemoveableInstances
- All Implemented Interfaces:
- java.io.Serializable
- public class ClassRemoveableInstances
- extends Instances
- Author:
- Arthur Zimek
- See Also:
- Serialized Form
Method Summary |
void |
deleteAttributeAt(int position)
Deletes an attribute at the given position
(0 to numAttributes() - 1). |
private void |
freshAttributeInfo()
Replaces the attribute information by a clone of
itself. |
void |
insertAttributeAt(Attribute att,
int position)
Inserts an attribute at the given position (0 to
numAttributes()) and sets all values to be missing.
|
Methods inherited from class weka.core.Instances |
add, attribute, attribute, attributeStats, attributeToDoubleArray, checkForStringAttributes, checkInstance, classAttribute, classIndex, compactify, delete, delete, deleteStringAttributes, deleteWithMissing, deleteWithMissing, deleteWithMissingClass, enumerateAttributes, enumerateInstances, equalHeaders, firstInstance, getInstance, getInstanceFull, getInstanceSparse, getRandomNumberGenerator, instance, lastInstance, main, meanOrMode, meanOrMode, mergeInstances, numAttributes, numClasses, numDistinctValues, numDistinctValues, numInstances, randomize, readHeader, readInstance, relationName, renameAttribute, renameAttribute, renameAttributeValue, renameAttributeValue, resample, resampleWithWeights, resampleWithWeights, setClass, setClassIndex, setRelationName, sort, sort, stratify, stringFreeStructure, sumOfWeights, test, testCV, toString, toSummaryString, trainCV, trainCV, variance, variance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
lastRemoved
private int lastRemoved
classRemoved
private boolean classRemoved
ClassRemoveableInstances
public ClassRemoveableInstances(java.io.Reader reader)
throws java.io.IOException
- Parameters:
reader
-
- Throws:
java.io.IOException
ClassRemoveableInstances
public ClassRemoveableInstances(java.io.Reader reader,
int capacity)
throws java.io.IOException
- Parameters:
reader
- capacity
-
- Throws:
java.io.IOException
ClassRemoveableInstances
public ClassRemoveableInstances(Instances dataset)
- Parameters:
dataset
-
ClassRemoveableInstances
public ClassRemoveableInstances(Instances dataset,
int capacity)
- Parameters:
dataset
- capacity
-
ClassRemoveableInstances
public ClassRemoveableInstances(Instances source,
int first,
int toCopy)
- Parameters:
source
- first
- toCopy
-
ClassRemoveableInstances
public ClassRemoveableInstances(java.lang.String name,
FastVector attInfo,
int capacity)
- Parameters:
name
- attInfo
- capacity
-
deleteAttributeAt
public void deleteAttributeAt(int position)
- Deletes an attribute at the given position
(0 to numAttributes() - 1). A deep copy of the attribute
information is performed before the attribute is deleted.
Allows deletion of the class-attribute.
- Overrides:
deleteAttributeAt
in class Instances
- Parameters:
position
- the attribute's position
- Throws:
java.lang.IllegalArgumentException
- if the given index is out of range
insertAttributeAt
public void insertAttributeAt(Attribute att,
int position)
- Inserts an attribute at the given position (0 to
numAttributes()) and sets all values to be missing.
Shallow copies the attribute before it is inserted, and performs
a deep copy of the existing attribute information.
- Overrides:
insertAttributeAt
in class Instances
- Parameters:
att
- the attribute to be insertedposition
- the attribute's position
- Throws:
java.lang.IllegalArgumentException
- if the given index is out of range
freshAttributeInfo
private void freshAttributeInfo()
- Replaces the attribute information by a clone of
itself.