| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Instance>
cc.mallet.types.InstanceList
cc.mallet.types.MultiInstanceList
public class MultiInstanceList
An implementation of InstanceList that logically combines multiple instance lists so that they appear as one list without copying the original lists. This is useful when running cross-validation experiments with large data sets. Any operation that would modify the size of the list is not supported.
InstanceList, 
Serialized Form| Nested Class Summary | 
|---|
| Nested classes/interfaces inherited from class cc.mallet.types.InstanceList | 
|---|
| InstanceList.CrossValidationIterator | 
| Field Summary | 
|---|
| Fields inherited from class cc.mallet.types.InstanceList | 
|---|
| TARGET_PROPERTY | 
| Fields inherited from class java.util.AbstractList | 
|---|
| modCount | 
| Constructor Summary | |
|---|---|
| MultiInstanceList(InstanceList[] lists)Constructs a MultiInstanceListwith an array ofInstanceList | |
| MultiInstanceList(java.util.List<InstanceList> lists)Constructs a MultiInstanceListwith aListofInstanceList | |
| Method Summary | ||
|---|---|---|
|  boolean | add(Instance instance)Appends the instance to this list without passing the instance through the InstanceList's pipe. | |
|  boolean | add(Instance instance,
    double instanceWeight)Appends the instance to this list without passing it through this InstanceList's pipe, assigning it the specified weight. | |
|  void | add(int index,
    Instance element) | |
|  void | clear() | |
|  java.lang.Object | clone() | |
|  InstanceList | cloneEmpty() | |
| protected  InstanceList | cloneEmptyInto(InstanceList ret) | |
|  boolean | contains(java.lang.Object elem) | |
|  InstanceList.CrossValidationIterator | crossValidationIterator(int nfolds) | |
|  InstanceList.CrossValidationIterator | crossValidationIterator(int nfolds,
                        int seed) | |
|  void | ensureCapacity(int minCapacity) | |
|  boolean | equals(java.lang.Object o) | |
|  Instance | get(int index) | |
|  int | hashCode() | |
|  int | indexOf(java.lang.Object elem) | |
|  boolean | isEmpty() | |
|  java.util.Iterator<Instance> | iterator() | |
|  int | lastIndexOf(java.lang.Object elem) | |
|  java.util.ListIterator<Instance> | listIterator() | |
|  java.util.ListIterator<Instance> | listIterator(int index) | |
|  boolean | remove(Instance instance) | |
|  Instance | remove(int index) | |
|  boolean | remove(java.lang.Object o) | |
|  Instance | set(int index,
    Instance instance) | |
|  void | setInstance(int index,
            Instance instance)Replaces the Instanceat positionindexwith a new one. | |
|  void | setInstanceWeight(Instance instance,
                  double weight) | |
|  InstanceList | shallowClone() | |
|  void | shuffle(java.util.Random r) | |
|  int | size() | |
|  InstanceList[] | split(double[] proportions) | |
|  InstanceList[] | split(java.util.Random r,
      double[] proportions)Shuffles the elements of this list among several smaller lists. | |
|  InstanceList[] | splitInOrder(double[] proportions)Chops this list into several sequential sublists. | |
|  InstanceList[] | splitInOrder(int[] counts) | |
|  InstanceList[] | splitInTwoByModulo(int m)Returns a pair of new lists such that the first list in the pair contains every mth element of this list, starting with the first. | |
|  InstanceList | subList(double proportion) | |
|  InstanceList | subList(int start,
        int end) | |
|  java.lang.Object[] | toArray() | |
| 
 | toArray(T[] a) | |
|  java.lang.String | toString() | |
|  void | trimToSize() | |
| Methods inherited from class java.util.ArrayList | 
|---|
| removeRange | 
| Methods inherited from class java.util.AbstractCollection | 
|---|
| containsAll, removeAll, retainAll | 
| Methods inherited from class java.lang.Object | 
|---|
| finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface java.util.List | 
|---|
| containsAll, removeAll, retainAll | 
| Constructor Detail | 
|---|
public MultiInstanceList(InstanceList[] lists)
MultiInstanceList with an array of InstanceList
lists - Array of InstanceList to logically combinepublic MultiInstanceList(java.util.List<InstanceList> lists)
MultiInstanceList with a List of InstanceList
lists - List of InstanceList to logically combine| Method Detail | 
|---|
public boolean add(Instance instance,
                   double instanceWeight)
InstanceList
add in class InstanceListtruepublic boolean add(Instance instance)
InstanceList
add in interface java.util.Collection<Instance>add in interface java.util.List<Instance>add in class InstanceListtrue
public void add(int index,
                Instance element)
add in interface java.util.List<Instance>add in class InstanceListpublic void clear()
clear in interface java.util.Collection<Instance>clear in interface java.util.List<Instance>clear in class InstanceListpublic java.lang.Object clone()
clone in class InstanceListpublic InstanceList cloneEmpty()
cloneEmpty in class InstanceListprotected InstanceList cloneEmptyInto(InstanceList ret)
cloneEmptyInto in class InstanceListpublic boolean contains(java.lang.Object elem)
contains in interface java.util.Collection<Instance>contains in interface java.util.List<Instance>contains in class java.util.ArrayList<Instance>
public InstanceList.CrossValidationIterator crossValidationIterator(int nfolds,
                                                                    int seed)
crossValidationIterator in class InstanceListpublic InstanceList.CrossValidationIterator crossValidationIterator(int nfolds)
crossValidationIterator in class InstanceListpublic void ensureCapacity(int minCapacity)
ensureCapacity in class java.util.ArrayList<Instance>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<Instance>equals in interface java.util.List<Instance>equals in class java.util.AbstractList<Instance>public Instance get(int index)
get in interface java.util.List<Instance>get in class java.util.ArrayList<Instance>public int hashCode()
hashCode in interface java.util.Collection<Instance>hashCode in interface java.util.List<Instance>hashCode in class java.util.AbstractList<Instance>public int indexOf(java.lang.Object elem)
indexOf in interface java.util.List<Instance>indexOf in class java.util.ArrayList<Instance>public boolean isEmpty()
isEmpty in interface java.util.Collection<Instance>isEmpty in interface java.util.List<Instance>isEmpty in class java.util.ArrayList<Instance>public java.util.Iterator<Instance> iterator()
iterator in interface java.lang.Iterable<Instance>iterator in interface java.util.Collection<Instance>iterator in interface java.util.List<Instance>iterator in class java.util.AbstractList<Instance>public int lastIndexOf(java.lang.Object elem)
lastIndexOf in interface java.util.List<Instance>lastIndexOf in class java.util.ArrayList<Instance>public java.util.ListIterator<Instance> listIterator()
listIterator in interface java.util.List<Instance>listIterator in class java.util.AbstractList<Instance>public java.util.ListIterator<Instance> listIterator(int index)
listIterator in interface java.util.List<Instance>listIterator in class java.util.AbstractList<Instance>public boolean remove(Instance instance)
remove in class InstanceListpublic Instance remove(int index)
remove in interface java.util.List<Instance>remove in class InstanceListpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collection<Instance>remove in interface java.util.List<Instance>remove in class java.util.ArrayList<Instance>
public Instance set(int index,
                    Instance instance)
set in interface java.util.List<Instance>set in class InstanceList
public void setInstance(int index,
                        Instance instance)
InstanceListInstance at position index
 with a new one.
setInstance in class InstanceList
public void setInstanceWeight(Instance instance,
                              double weight)
setInstanceWeight in class InstanceListpublic InstanceList shallowClone()
shallowClone in class InstanceListpublic void shuffle(java.util.Random r)
shuffle in class InstanceListpublic int size()
size in interface java.util.Collection<Instance>size in interface java.util.List<Instance>size in class java.util.ArrayList<Instance>public InstanceList[] split(double[] proportions)
split in class InstanceList
public InstanceList[] split(java.util.Random r,
                            double[] proportions)
InstanceList
split in class InstanceListr - The source of randomness to use in shuffling.proportions - A list of numbers (not necessarily summing to 1) which,
 when normalized, correspond to the proportion of elements in each returned
 sublist.  This method (and all the split methods) do not transfer the Instance
 weights to the resulting InstanceLists.
InstanceList for each element of proportionspublic InstanceList[] splitInOrder(double[] proportions)
InstanceList
splitInOrder in class InstanceListproportions - A list of numbers corresponding to the proportion of
 elements in each returned sublist.  If not already normalized to sum to 1.0, it will be normalized here.
InstanceList for each element of proportionspublic InstanceList[] splitInOrder(int[] counts)
splitInOrder in class InstanceListpublic InstanceList[] splitInTwoByModulo(int m)
InstanceListmth element of this list, starting with the first.
 The second list contains all remaining elements.
splitInTwoByModulo in class InstanceListpublic InstanceList subList(double proportion)
subList in class InstanceList
public InstanceList subList(int start,
                            int end)
subList in interface java.util.List<Instance>subList in class InstanceListpublic java.lang.Object[] toArray()
toArray in interface java.util.Collection<Instance>toArray in interface java.util.List<Instance>toArray in class java.util.ArrayList<Instance>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<Instance>toArray in interface java.util.List<Instance>toArray in class java.util.ArrayList<Instance>public java.lang.String toString()
toString in class java.util.AbstractCollection<Instance>public void trimToSize()
trimToSize in class java.util.ArrayList<Instance>| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||