程序包 weka.core
类 StringLocator
java.lang.Object
weka.core.AttributeLocator
weka.core.StringLocator
- 所有已实现的接口:
Serializable
,Comparable<AttributeLocator>
,RevisionHandler
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.
- 版本:
- $Revision: 6226 $
- 作者:
- fracpete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器构造器说明StringLocator
(Instances data) initializes the StringLocator with the given dataStringLocator
(Instances data, int[] indices) Initializes the AttributeLocator with the given data.StringLocator
(Instances data, int fromIndex, int toIndex) Initializes the StringLocator with the given data. -
方法概要
修饰符和类型方法说明static void
copyStringValues
(Instance instance, boolean instSrcCompat, Instances srcDataset, AttributeLocator srcLoc, Instances destDataset, AttributeLocator destLoc) Takes string values referenced by an Instance and copies them from a source dataset to a destination dataset.static void
copyStringValues
(Instance inst, Instances destDataset, AttributeLocator strAtts) Copies string values contained in the instance copied to a new dataset.Returns the revision string.从类继承的方法 weka.core.AttributeLocator
compareTo, equals, getActualIndex, getAllowedIndices, getAttributeIndices, getData, getLocator, getLocatorIndices, getType, toString
-
构造器详细资料
-
StringLocator
initializes the StringLocator with the given data- 参数:
data
- the data to work on
-
StringLocator
Initializes the StringLocator with the given data. Checks only the given range.- 参数:
data
- the data to work onfromIndex
- the first index to inspect (including)toIndex
- the last index to check (including)
-
StringLocator
Initializes the AttributeLocator with the given data. Checks only the specified attribute indices.- 参数:
data
- the data to work onindices
- the attribute indices to check
-
-
方法详细资料
-
copyStringValues
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.- 参数:
inst
- the Instance containing the string values to copy.destDataset
- the destination set of InstancesstrAtts
- 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) 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).- 参数:
instance
- the instance containing references to strings in the source dataset that will have references updated to be valid for the destination dataset.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).srcDataset
- the dataset for which the current instance string references are valid (after any position mapping if needed)srcLoc
- an AttributeLocator containing the indices of string attributes in the source datset.destDataset
- the dataset for which the current instance string references need to be inserted (after any position mapping if needed)destLoc
- an AttributeLocator containing the indices of string attributes in the destination datset.
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中AttributeLocator
- 返回:
- the revision
-