Class LOLTensorData
java.lang.Object
com.linkedin.feathr.common.tensor.LOLTensorData
- All Implemented Interfaces:
TensorData
Each list is of the same length and stores a single dimension (similarly to parallel arrays).
There are as many dimensions as elements in columnTypes minus one.
columnTypes describe the primitive type of the corresponding column (a dimension or a value).
Instances of this class are expected to be only constructed from existing lists (e.g., from Avro or Pegasus),
so no corresponding builder class is provided.
-
Constructor Summary
ConstructorsConstructorDescriptionLOLTensorData(Representable[] columnTypes, List<List<?>> dimensions, List<?> values) LOLTensorData(Representable[] columnTypes, List<List<?>> dimensions, List<?> values, boolean sort) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.feathr.common.tensor.TensorData
getArity, getShape
-
Constructor Details
-
LOLTensorData
public LOLTensorData(Representable[] columnTypes, List<List<?>> dimensions, List<?> values, boolean sort) -
LOLTensorData
-
-
Method Details
-
getTypes
- Specified by:
getTypesin interfaceTensorData- Returns:
- the types of all dimensions and the value as a single array.
-
estimatedCardinality
public int estimatedCardinality()- Specified by:
estimatedCardinalityin interfaceTensorData- Returns:
- conservative estimate of number of entries in the mapping from dimensions to values. Can be cheaper to evaluate than the exact one.
-
cardinality
public int cardinality()- Specified by:
cardinalityin interfaceTensorData- Returns:
- exact number of entries in the mapping from dimensions to values.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceTensorData
-
iterator
- Specified by:
iteratorin interfaceTensorData- Returns:
- an iterator over entries in the mapping from dimensions to the value.
-
getDimensions
-
getValues
-