medusa.georgios.enhanced_mcl
Class Fold
- java.lang.Object
-
- medusa.georgios.enhanced_mcl.Fold
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanadd(Instance i)Add an instance to this data set.voidadd(int index, Instance element)booleanaddAll(java.util.Collection<? extends Instance> c)booleanaddAll(int index, java.util.Collection<? extends Instance> c)java.util.SortedSet<java.lang.Object>classes()Returns a set containing all different classes in this data set.intclassIndex(java.lang.Object clazz)Returns the index of the class value in the supplied data set.java.lang.ObjectclassValue(int index)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)Dataset[]folds(int numFolds, java.util.Random rg)Create a number of folds from the data set and return them.Instanceget(int index)intindexOf(java.lang.Object o)Instanceinstance(int index)Get the instance with a certain index.booleanisEmpty()java.util.Iterator<Instance>iterator()java.util.Set<Instance>kNearest(int k, Instance inst)Returns the k closest instances.intlastIndexOf(java.lang.Object o)java.util.ListIterator<Instance>listIterator()java.util.ListIterator<Instance>listIterator(int index)intnoAttributes()The number of attributes in each instance.Instanceremove(int index)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)Instanceset(int index, Instance element)intsize()java.util.List<Instance>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] a)
-
-
-
Constructor Detail
-
Fold
public Fold(Dataset parent, int[] indices)
-
-
Method Detail
-
add
public boolean add(Instance i)
Description copied from interface:DatasetAdd an instance to this data set. The compatibility of the new item with the items in the data set should be checked by the implementation. Incompatible items should not be added to the data set.
-
classes
public java.util.SortedSet<java.lang.Object> classes()
Description copied from interface:DatasetReturns a set containing all different classes in this data set. If no classes are available, this will return the empty set.
-
folds
public Dataset[] folds(int numFolds, java.util.Random rg)
Description copied from interface:DatasetCreate a number of folds from the data set and return them. The supplied random generator is used to determine which instances are assigned to each of the folds.
-
instance
public Instance instance(int index)
Description copied from interface:DatasetGet the instance with a certain index.
-
kNearest
public java.util.Set<Instance> kNearest(int k, Instance inst)
Description copied from interface:DatasetReturns the k closest instances.
-
add
public void add(int index, Instance element)- Specified by:
addin interfacejava.util.List<Instance>
-
addAll
public boolean addAll(java.util.Collection<? extends Instance> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends Instance> c)- Specified by:
addAllin interfacejava.util.List<Instance>
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOfin interfacejava.util.List<Instance>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<Instance> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<Instance>
-
listIterator
public java.util.ListIterator<Instance> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<Instance>
-
listIterator
public java.util.ListIterator<Instance> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<Instance>
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
set
public Instance set(int index, Instance element)
- Specified by:
setin interfacejava.util.List<Instance>
-
size
public int size()
-
subList
public java.util.List<Instance> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<Instance>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
noAttributes
public int noAttributes()
Description copied from interface:DatasetThe number of attributes in each instance. This value can be off when instances have different number of attributes. When the data set contains no instances, this method should return 0.- Specified by:
noAttributesin interfaceDataset- Returns:
-
classIndex
public int classIndex(java.lang.Object clazz)
Description copied from interface:DatasetReturns the index of the class value in the supplied data set. This method will return -1 if the class value of this instance is not set.- Specified by:
classIndexin interfaceDataset- Returns:
- the index of the class value
-
classValue
public java.lang.Object classValue(int index)
- Specified by:
classValuein interfaceDataset
-
-
DMelt 3.0 © DataMelt by jWork.ORG