Example usage for Java weka.core Instances fields, constructors, methods, implement or subclass
The text is from its open source code.
String | SERIALIZED_OBJ_FILE_EXTENSION The filename extension that should be used for bin. |
String | ARFF_RELATION The keyword used to denote the start of an arff header |
String | ARFF_DATA The keyword used to denote the start of the arff data section |
Instances(Instances source, int first, int toCopy) Creates a new set of instances by copying a subset of another set. | |
Instances(String name, ArrayList Creates an empty set of instances. | |
Instances(Reader reader) Reads an ARFF file from a reader, and assigns a weight of one to each instance. | |
Instances(Instances dataset) Constructor copying all instances and references to the header information from the given set of instances. | |
Instances(Reader reader, int capacity) Reads the header of an ARFF file from a reader and reserves space for the given number of instances. | |
Instances(Instances dataset, int capacity) Constructor creating an empty set of instances. |
boolean | add(Instance instance) Adds one instance to the end of the set. |
void | add(int index, Instance instance) Adds one instance at the given position in the list. |
Attribute | attribute(int index) Returns an attribute. |
Attribute | attribute(String name) Returns an attribute given its name. |
AttributeStats | attributeStats(int index) Calculates summary statistics on the values that appear in this set of instances for a specified attribute. |
double[] | attributeToDoubleArray(int index) Gets the value of all instances in this dataset for a particular attribute. |
boolean | checkForAttributeType(int attType) Checks for attributes of the given type in the dataset |
boolean | checkForStringAttributes() Checks for string attributes in the dataset |
boolean | checkInstance(Instance instance) Checks if the given instance is compatible with this dataset. |
Attribute | classAttribute() Returns the class attribute. |
int | classIndex() Returns the class attribute's index. |
void | compactify() Compactifies the set of instances. |
void | delete(int index) Removes an instance at the given position from the set. |
void | delete() Removes all instances from the set. |
void | deleteAttributeAt(int position) Deletes an attribute at the given position (0 to numAttributes() - 1). |
void | deleteAttributeType(int attType) Deletes all attributes of the given type in the dataset. |
void | deleteStringAttributes() Deletes all string attributes in the dataset. |
void | deleteWithMissing(int attIndex) Removes all instances with missing values for a particular attribute from the dataset. |
void | deleteWithMissing(Attribute att) Removes all instances with missing values for a particular attribute from the dataset. |
void | deleteWithMissingClass() Removes all instances with a missing class value from the dataset. |
Enumeration | enumerateAttributes() Returns an enumeration of all the attributes. |
Enumeration | enumerateInstances() Returns an enumeration of all instances in the dataset. |
boolean | equalHeaders(Instances dataset) Checks if two headers are equivalent. |
String | equalHeadersMsg(Instances dataset) Checks if two headers are equivalent. |
Instance | firstInstance() Returns the first instance in the set. |
Instance | get(int index) Returns the instance at the given position. |
Random | getRandomNumberGenerator(long seed) Returns a random number generator. |
void | insertAttributeAt(Attribute att, int position) Inserts an attribute at the given position (0 to numAttributes()) and sets all values to be missing. |
Instance | instance(int index) Returns the instance at the given position. |
double | kthSmallestValue(Attribute att, int k) Returns the kth-smallest attribute value of a numeric attribute. |
double | kthSmallestValue(int attIndex, int k) Returns the kth-smallest attribute value of a numeric attribute. |
Instance | lastInstance() Returns the last instance in the set. |
double | meanOrMode(int attIndex) Returns the mean (mode) for a numeric (nominal) attribute as a floating-point value. |
double | meanOrMode(Attribute att) Returns the mean (mode) for a numeric (nominal) attribute as a floating-point value. |
Instances | mergeInstances(Instances first, Instances second) Merges two sets of Instances together. |
int | numAttributes() Returns the number of attributes. |
int | numClasses() Returns the number of class labels. |
int | numDistinctValues(int attIndex) Returns the number of distinct values of a given attribute. |
int | numDistinctValues(Attribute att) Returns the number of distinct values of a given attribute. |
int | numInstances() Returns the number of instances in the dataset. |
void | randomize(Random random) Shuffles the instances in the set so that they are ordered randomly. |
boolean | readInstance(Reader reader) Reads a single instance from the reader and appends it to the dataset. |
String | relationName() Returns the relation's name. |
Instance | remove(int index) Removes the instance at the given position. |
void | renameAttribute(int att, String name) Renames an attribute. |
void | renameAttribute(Attribute att, String name) Renames an attribute. |
void | renameAttributeValue(int att, int val, String name) Renames the value of a nominal (or string) attribute value. |
void | renameAttributeValue(Attribute att, String val, String name) Renames the value of a nominal (or string) attribute value. |
Instances | resample(Random random) Creates a new dataset of the same size as this dataset using random sampling with replacement. |
Instances | resampleWithWeights(Random random, boolean[] sampled, boolean representUsingWeights) Creates a new dataset of the same size as this dataset using random sampling with replacement according to the current instance weights. |
Instances | resampleWithWeights(Random random, double[] weights, boolean[] sampled) Creates a new dataset of the same size as this dataset using random sampling with replacement according to the given weight vector. |
Instances | resampleWithWeights(Random random, boolean[] sampled) Creates a new dataset of the same size as this dataset using random sampling with replacement according to the current instance weights. |
Instances | resampleWithWeights(Random random, boolean representUsingWeights) Creates a new dataset of the same size as this dataset using random sampling with replacement according to the current instance weights. |
Instances | resampleWithWeights(Random random, double[] weights) Creates a new dataset of the same size as this dataset using random sampling with replacement according to the given weight vector. |
Instances | resampleWithWeights(Random random) Creates a new dataset of the same size as this dataset using random sampling with replacement according to the current instance weights. |
Instance | set(int index, Instance instance) Replaces the instance at the given position. |
void | setClass(Attribute att) Sets the class attribute. |
void | setClassIndex(int classIndex) Sets the class index of the set. |
void | setRelationName(String newName) Sets the relation's name. |
int | size() Returns the number of instances in the dataset. |
void | sort(int attIndex) Sorts the instances based on an attribute. |
void | sort(Attribute att) Sorts the instances based on an attribute. |
void | stratify(int numFolds) Stratifies a set of instances according to its class values if the class attribute is nominal (so that afterwards a stratified cross-validation can be performed). |
Instances | stringFreeStructure() Create a copy of the structure. |
double | sumOfWeights() Computes the sum of all the instances' weights. |
void | swap(int i, int j) Swaps two instances in the set. |
Instances | testCV(int numFolds, int numFold) Creates the test set for one fold of a cross-validation on the dataset. |
String | toString() Returns the dataset as a string in ARFF format. |
String | toSummaryString() Generates a string summarizing the set of instances. |
Instances | trainCV(int numFolds, int numFold) Creates the training set for one fold of a cross-validation on the dataset. |
Instances | trainCV(int numFolds, int numFold, Random random) Creates the training set for one fold of a cross-validation on the dataset. |
double | variance(int attIndex) Computes the variance for a numeric attribute. |
double | variance(Attribute att) Computes the variance for a numeric attribute. |
double[] | variances() Computes the variance for all numeric attributes simultaneously. |