medusa.georgios.enhanced_mcl
Interface Dataset
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description booleanadd(Instance i)Add an instance to this data set.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)Dataset[]folds(int numFolds, java.util.Random rg)Create a number of folds from the data set and return them.Instanceinstance(int index)Get the instance with a certain index.java.util.Set<Instance>kNearest(int k, Instance inst)Returns the k closest instances.intnoAttributes()The number of attributes in each instance.
-
-
-
Method Detail
-
kNearest
java.util.Set<Instance> kNearest(int k, Instance inst)
Returns the k closest instances.- Parameters:
k-dm-inst-- Returns:
-
classes
java.util.SortedSet<java.lang.Object> classes()
Returns a set containing all different classes in this data set. If no classes are available, this will return the empty set.- Returns:
-
add
boolean add(Instance i)
Add 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.
-
instance
Instance instance(int index)
Get the instance with a certain index.- Parameters:
index- the index of the instance you want to retrieve.- Returns:
-
folds
Dataset[] folds(int numFolds, java.util.Random rg)
Create 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.- Parameters:
numFolds- the number of folds to createrg- the random generator- Returns:
- an array of data sets that contains
numFoldsdata sets.
-
noAttributes
int noAttributes()
The 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.- Returns:
-
classIndex
int classIndex(java.lang.Object clazz)
Returns 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.- Parameters:
data- the data set to give the index for- Returns:
- the index of the class value
-
classValue
java.lang.Object classValue(int index)
-
-
DMelt 3.0 © DataMelt by jWork.ORG