Class MultiColumnEncoder
java.lang.Object
org.apache.sysds.runtime.transform.encode.MultiColumnEncoder
- All Implemented Interfaces:
Externalizable,Serializable,Encoder
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends LegacyEncoder>
voidaddReplaceLegacyEncoder(T encoder) voidallocateMetaData(FrameBlock meta) Pre-allocate a FrameBlock for metadata collection.apply(CacheBlock<?> in) apply(CacheBlock<?> in, int k) apply(CacheBlock<?> in, MatrixBlock out, int outputCol) Apply the generated metadata to the FrameBlock and saved the result in out.apply(CacheBlock<?> in, MatrixBlock out, int outputCol, int k, org.apache.sysds.runtime.transform.encode.MultiColumnEncoder.EncoderMeta encm, long nnz) void<T extends ColumnEncoder,E>
voidapplyToAll(Class<T> type, Consumer<? super T> function) <T extends ColumnEncoder,E>
voidapplyToAll(Consumer<? super ColumnEncoderComposite> function) voidbuild(CacheBlock<?> in) Build the transform meta data for the given block input.voidbuild(CacheBlock<?> in, int k) voidbuild(CacheBlock<?> in, int k, Map<Integer, double[]> equiHeightBinMaxs) voidPartial build of internal data structures (e.g., in distributed spark operations).<T extends ColumnEncoder>
booleancontainsEncoderForID(int colID, Class<T> type) encode(CacheBlock<?> in) encode(CacheBlock<?> in, boolean compressedOut) encode(CacheBlock<?> in, int k) encode(CacheBlock<?> in, int k, boolean compressedOut) getColMapping(FrameBlock meta) Obtain the column mapping of encoded frames based on the passed meta data frame.<T extends ColumnEncoder>
TgetColumnEncoder(int colID, Class<T> type) <T extends ColumnEncoder>
List<T>getColumnEncoders(Class<T> type) getCompositeEncodersForID(int colID) List<Class<? extends ColumnEncoder>>List<Class<? extends ColumnEncoder>>getEncoderTypes(int colID) <T extends ColumnEncoder,E>
List<E>getFromAll(Class<T> type, Function<? super T, ? extends E> mapper) <T extends ColumnEncoder>
double[]getFromAllDoubleArray(Class<T> type, Function<? super T, ? extends Double> mapper) <T extends ColumnEncoder>
int[]getFromAllIntArray(Class<T> type, Function<? super T, ? extends Integer> mapper) <T extends LegacyEncoder>
TgetLegacyEncoder(Class<T> type) getMetaData(FrameBlock meta) Construct a frame block out of the transform meta data.getMetaData(FrameBlock meta, int k) intgetNumExtraCols(IndexRange ixRange) int<T extends LegacyEncoder>
boolean<T extends LegacyEncoder>
booleanhasLegacyEncoder(Class<T> type) voidinitEmbeddings(MatrixBlock embeddings) voidinitMetaData(FrameBlock meta) Sets up the required meta data for a subsequent call to apply.booleanisCompressedTransformEncode(CacheBlock<?> in, boolean enabled) voidvoidvoidmergeReplace(MultiColumnEncoder multiEncoder) voidAllocates internal data structures for partial build.voidsubRangeEncoder(IndexRange ixRange) <T extends ColumnEncoder>
MultiColumnEncodersubRangeEncoder(IndexRange ixRange, Class<T> type) toString()voidvoidupdateIndexRanges(long[] beginDims, long[] endDims, int offset) Update index-ranges to after encoding.void
-
Field Details
-
MULTI_THREADED_STAGES
public static boolean MULTI_THREADED_STAGES -
APPLY_ENCODER_SEPARATE_STAGES
public static boolean APPLY_ENCODER_SEPARATE_STAGES
-
-
Constructor Details
-
MultiColumnEncoder
-
MultiColumnEncoder
-
MultiColumnEncoder
public MultiColumnEncoder()
-
-
Method Details
-
encode
-
encode
-
encode
-
encode
-
build
Description copied from interface:EncoderBuild the transform meta data for the given block input. This call modifies and keeps meta data as encoder state. -
build
-
build
-
legacyBuild
-
apply
-
apply
-
updateAllDCEncoders
public void updateAllDCEncoders() -
apply
Description copied from interface:EncoderApply the generated metadata to the FrameBlock and saved the result in out. -
apply
public MatrixBlock apply(CacheBlock<?> in, MatrixBlock out, int outputCol, int k, org.apache.sysds.runtime.transform.encode.MultiColumnEncoder.EncoderMeta encm, long nnz) -
allocateMetaData
Description copied from interface:EncoderPre-allocate a FrameBlock for metadata collection.- Specified by:
allocateMetaDatain interfaceEncoder- Parameters:
meta- frame block
-
getMetaData
Description copied from interface:EncoderConstruct a frame block out of the transform meta data.- Specified by:
getMetaDatain interfaceEncoder- Parameters:
meta- output frame block- Returns:
- output frame block?
-
getMetaData
-
initMetaData
Description copied from interface:EncoderSets up the required meta data for a subsequent call to apply.- Specified by:
initMetaDatain interfaceEncoder- Parameters:
meta- frame block
-
initEmbeddings
-
prepareBuildPartial
public void prepareBuildPartial()Description copied from interface:EncoderAllocates internal data structures for partial build.- Specified by:
prepareBuildPartialin interfaceEncoder
-
buildPartial
Description copied from interface:EncoderPartial build of internal data structures (e.g., in distributed spark operations).- Specified by:
buildPartialin interfaceEncoder- Parameters:
in- input frame block
-
getColMapping
Obtain the column mapping of encoded frames based on the passed meta data frame.- Parameters:
meta- meta data frame block- Returns:
- matrix with column mapping (one row per attribute)
-
updateIndexRanges
public void updateIndexRanges(long[] beginDims, long[] endDims, int offset) Description copied from interface:EncoderUpdate index-ranges to after encoding. Note that only Dummycoding changes the ranges.- Specified by:
updateIndexRangesin interfaceEncoder- Parameters:
beginDims- begin dimensions of rangeendDims- end dimensions of rangeoffset- is applied to begin and endDims
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
getColumnEncoders
-
getColumnEncoder
-
getFromAll
public <T extends ColumnEncoder,E> List<E> getFromAll(Class<T> type, Function<? super T, ? extends E> mapper) -
getFromAllIntArray
public <T extends ColumnEncoder> int[] getFromAllIntArray(Class<T> type, Function<? super T, ? extends Integer> mapper) -
getFromAllDoubleArray
public <T extends ColumnEncoder> double[] getFromAllDoubleArray(Class<T> type, Function<? super T, ? extends Double> mapper) -
getColumnEncoders
-
getCompositeEncodersForID
-
getEncoderTypes
-
getEncoderTypes
-
getNumOutCols
public int getNumOutCols() -
getNumExtraCols
-
containsEncoderForID
-
applyToAll
-
applyToAll
public <T extends ColumnEncoder,E> void applyToAll(Consumer<? super ColumnEncoderComposite> function) -
subRangeEncoder
-
subRangeEncoder
public <T extends ColumnEncoder> MultiColumnEncoder subRangeEncoder(IndexRange ixRange, Class<T> type) -
mergeReplace
-
mergeAt
-
addReplaceLegacyEncoder
-
hasLegacyEncoder
-
isCompressedTransformEncode
-
hasLegacyEncoder
-
getLegacyEncoder
-
applyColumnOffset
public void applyColumnOffset() -
toString
-