public class CategoricalWrappedVec extends Vec
The Vector's domain is the union of the Test and Train domains.
The mapping is defined by int[] array, size is input Test.domain.length. Contents refer to values in the Train.domain. Extra values in the Test domain are sorted after the Train.domain - so mapped values have to be range-checked (note that returning some flag for NA, say -1, would also need to be checked for).
Modifier and Type | Class and Description |
---|---|
static class |
CategoricalWrappedVec.CategoricalWrappedChunk |
Vec.ESPC, Vec.Holder, Vec.Reader, Vec.VectorGroup, Vec.Writer
_cids, _rowLayout, DO_HISTOGRAMS, KEY_PREFIX_LEN, PERCENTILES, T_BAD, T_CAT, T_NUM, T_STR, T_TIME, T_UUID, TYPE_STR
Constructor and Description |
---|
CategoricalWrappedVec(Key key,
int rowLayout,
java.lang.String[] toDomain,
Key masterVecKey)
Main constructor: convert from one categorical to another
|
Modifier and Type | Method and Description |
---|---|
Chunk |
chunkForChunkIdx(int cidx)
Map from chunk-index to Chunk.
|
static int[] |
computeMap(java.lang.String[] from,
java.lang.String[] to) |
Vec |
doCopy() |
Vec |
masterVec() |
static Vec |
updateDomain(Vec source,
java.lang.String[] toDomain)
Updates Vec's domain in-place (instead of creating a wrapper Vec)
|
adaptTo, align, at, at16h, at16l, at8, atStr, base, bins, byteSize, cardinality, checksum_impl, chunkForRow, chunkIdx, chunkKey, chunkKey, chunkLen, copyMeta, domain, elem2ChunkIdx, equals, espc, factor, get_type_str, get_type, getVecKey, group, hashCode, isBad, isBinary, isCategorical, isCompatibleWith, isConst, isDomainTruncated, isHomedLocally, isInt, isNA, isNumeric, isString, isTime, isUUID, isVolatile, lazy_bins, length, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeCon, makeConN, makeCons, makeCons, makeCopy, makeCopy, makeCopy, makeDoubles, makeRand, makeRepSeq, makeSeq, makeSeq, makeSeq, makeTimeVec, makeVec, makeVec, makeVec, makeVec, makeVec, makeVec, makeVolatileDoubles, makeVolatileInts, makeZero, makeZero, makeZero, makeZero, makeZero, makeZeros, makeZeros, max, maxs, mean, min, mins, mode, naCnt, nChunks, nChunksFor, newKey, ninfs, nonEmptyChunks, nzCnt, open, pctiles, pinfs, postWrite, preWriting, readAll_impl, remove_impl, rollupStatsKey, set, set, set, set, set, setBad, setChunkIdx, setDomain, setNA, sigma, sparseRatio, startRollupStats, startRollupStats, stride, stringAt, toCategoricalVec, toNumericVec, toString, toStringVec, toTwoDimTable, toTwoDimTable, writeAll_impl
checksum, makeSchema, readAll, remove, remove, remove, remove, writeAll
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonString, write, writeExternal, writeJSON
public static int[] computeMap(java.lang.String[] from, java.lang.String[] to)
public static Vec updateDomain(Vec source, java.lang.String[] toDomain)
source
- source VectoDomain
- target domainpublic Chunk chunkForChunkIdx(int cidx)
public Vec masterVec()