com.rapidminer.tools
Class WekaInstancesAdaptor

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<weka.core.Instance>
          extended by weka.core.Instances
              extended by com.rapidminer.tools.WekaInstancesAdaptor
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<weka.core.Instance>, java.util.Collection<weka.core.Instance>, java.util.List<weka.core.Instance>, weka.core.RevisionHandler

public class WekaInstancesAdaptor
extends weka.core.Instances

This class extends the Weka class Instances and overrides all methods needed to directly use a RapidMiner ExampleSet as source for Weka instead of copying the complete data.

Author:
Ingo Mierswa ingomierswa Exp $
See Also:
Serialized Form

Field Summary
static int ASSOCIATION_RULE_MINING
           
static int CLUSTERING
           
static int LEARNING
           
static int PREDICTING
           
static int WEIGHTING
           
 
Fields inherited from class weka.core.Instances
ARFF_DATA, ARFF_RELATION, FILE_EXTENSION, m_Attributes, m_ClassIndex, m_Instances, m_Lines, m_RelationName, SERIALIZED_OBJ_FILE_EXTENSION
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
WekaInstancesAdaptor(java.lang.String name, ExampleSet exampleSet, int taskType)
          Creates a new Instances object based on the given example set.
 
Method Summary
 java.util.Enumeration enumerateInstances()
          Returns an instance enumeration based on an ExampleReader.
 weka.core.Instance instance(int i)
          Returns the i-th instance.
 int numInstances()
          Returns the number of instances.
protected  java.lang.Object readResolve()
           
 
Methods inherited from class weka.core.Instances
add, add, attribute, attribute, attributeStats, attributeToDoubleArray, checkForAttributeType, checkForStringAttributes, checkInstance, classAttribute, classIndex, compactify, copyInstances, delete, delete, deleteAttributeAt, deleteAttributeType, deleteStringAttributes, deleteWithMissing, deleteWithMissing, deleteWithMissingClass, enumerateAttributes, equalHeaders, equalHeadersMsg, firstInstance, freshAttributeInfo, get, getRandomNumberGenerator, getRevision, initialize, insertAttributeAt, instancesAndWeights, kthSmallestValue, kthSmallestValue, lastInstance, main, meanOrMode, meanOrMode, mergeInstances, numAttributes, numClasses, numDistinctValues, numDistinctValues, partition, quickSort, randomize, readInstance, relationName, remove, renameAttribute, renameAttribute, renameAttributeValue, renameAttributeValue, resample, resampleWithWeights, resampleWithWeights, select, set, setClass, setClassIndex, setRelationName, size, sort, sort, stratify, stratStep, stringFreeStructure, stringWithoutHeader, sumOfWeights, swap, test, testCV, toString, toSummaryString, trainCV, trainCV, variance, variance
 
Methods inherited from class java.util.AbstractList
addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

LEARNING

public static final int LEARNING
See Also:
Constant Field Values

PREDICTING

public static final int PREDICTING
See Also:
Constant Field Values

CLUSTERING

public static final int CLUSTERING
See Also:
Constant Field Values

ASSOCIATION_RULE_MINING

public static final int ASSOCIATION_RULE_MINING
See Also:
Constant Field Values

WEIGHTING

public static final int WEIGHTING
See Also:
Constant Field Values
Constructor Detail

WekaInstancesAdaptor

public WekaInstancesAdaptor(java.lang.String name,
                            ExampleSet exampleSet,
                            int taskType)
                     throws OperatorException
Creates a new Instances object based on the given example set.

Throws:
OperatorException
Method Detail

readResolve

protected java.lang.Object readResolve()

enumerateInstances

public java.util.Enumeration enumerateInstances()
Returns an instance enumeration based on an ExampleReader.

Overrides:
enumerateInstances in class weka.core.Instances

instance

public weka.core.Instance instance(int i)
Returns the i-th instance.

Overrides:
instance in class weka.core.Instances

numInstances

public int numInstances()
Returns the number of instances.

Overrides:
numInstances in class weka.core.Instances


Copyright © 2001-2009 by Rapid-I