weka.core
Class ClassRemoveableInstances

java.lang.Object
  extended byweka.core.Instances
      extended byweka.core.ClassRemoveableInstances
All Implemented Interfaces:
java.io.Serializable

public class ClassRemoveableInstances
extends Instances

Author:
Arthur Zimek
See Also:
Serialized Form

Field Summary
private  boolean classRemoved
           
private  int lastRemoved
           
 
Fields inherited from class weka.core.Instances
ARFF_DATA, ARFF_RELATION, FILE_EXTENSION, m_Attributes, m_ClassIndex, m_IndicesBuffer, m_Instances, m_RelationName, m_ValueBuffer
 
Constructor Summary
ClassRemoveableInstances(Instances dataset)
           
ClassRemoveableInstances(Instances dataset, int capacity)
           
ClassRemoveableInstances(Instances source, int first, int toCopy)
           
ClassRemoveableInstances(java.io.Reader reader)
           
ClassRemoveableInstances(java.io.Reader reader, int capacity)
           
ClassRemoveableInstances(java.lang.String name, FastVector attInfo, int capacity)
           
 
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
 

Field Detail

lastRemoved

private int lastRemoved

classRemoved

private boolean classRemoved
Constructor Detail

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 -
Method Detail

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 inserted
position - 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.