| java.lang.Object weka.core.AttributeLocator weka.core.StringLocator
StringLocator | public class StringLocator extends AttributeLocator (Code) | | This class locates and records the indices of String attributes,
recursively in case of Relational attributes. The indices are normally
used for copying the Strings from one Instances object to another.
author: fracpete (fracpete at waikato dot ac dot nz) version: $Revision: 1.3 $ See Also: Attribute.STRING See Also: Attribute.RELATIONAL |
StringLocator | public StringLocator(Instances data)(Code) | | initializes the StringLocator with the given data
Parameters: data - the data to work on |
StringLocator | public StringLocator(Instances data, int fromIndex, int toIndex)(Code) | | Initializes the StringLocator with the given data.
Checks only the given range.
Parameters: data - the data to work on Parameters: fromIndex - the first index to inspect (including) Parameters: toIndex - the last index to check (including) |
StringLocator | public StringLocator(Instances data, int[] indices)(Code) | | Initializes the AttributeLocator with the given data.
Checks only the specified attribute indices.
Parameters: data - the data to work on Parameters: indices - the attribute indices to check |
copyStringValues | public static void copyStringValues(Instance inst, Instances destDataset, AttributeLocator strAtts)(Code) | | Copies string values contained in the instance copied to a new
dataset. The Instance must already be assigned to a dataset. This
dataset and the destination dataset must have the same structure.
Parameters: inst - the Instance containing the string values to copy. Parameters: destDataset - the destination set of Instances Parameters: strAtts - an AttributeLocator containing the indices of any string attributes in the dataset. |
copyStringValues | public static void copyStringValues(Instance instance, boolean instSrcCompat, Instances srcDataset, AttributeLocator srcLoc, Instances destDataset, AttributeLocator destLoc)(Code) | | Takes string values referenced by an Instance and copies them from a
source dataset to a destination dataset. The instance references are
updated to be valid for the destination dataset. The instance may have the
structure (i.e. number and attribute position) of either dataset (this
affects where references are obtained from). Only works if the number
of string attributes is the same in both indices (implicitly these string
attributes should be semantically same but just with shifted positions).
Parameters: instance - the instance containing references to strings in the source dataset that will have references updated to be valid for the destination dataset. Parameters: instSrcCompat - true if the instance structure is the same as the source, or false if it is the same as the destination (i.e. which of the string attribute indices contains the correct locations for this instance). Parameters: srcDataset - the dataset for which the current instance string references are valid (after any position mapping if needed) Parameters: srcLoc - an AttributeLocator containing the indices of string attributes in the source datset. Parameters: destDataset - the dataset for which the current instance string references need to be inserted (after any position mapping if needed) Parameters: destLoc - an AttributeLocator containing the indices of string attributes in the destination datset. |
|
|