Class NumpyArrayOperationWithAxisReduction<InputType,OutputType>
- java.lang.Object
-
- ai.sklearn4j.core.libraries.numpy.NumpyArrayOperationWithAxisReduction<InputType,OutputType>
-
- Type Parameters:
InputType- The element type of the input numpy array.OutputType- The element type of the output numpy array.
public abstract class NumpyArrayOperationWithAxisReduction<InputType,OutputType> extends Object
Base class for all the operations that performs an aggregation and reduction on a given NumpyArray.
-
-
Constructor Summary
Constructors Constructor Description NumpyArrayOperationWithAxisReduction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description NumpyArray<OutputType>apply(NumpyArray<InputType> array, int axis, boolean keepDimensions)Applies the operation on the numpy array.NumpyArray<OutputType>createInstanceResultNumpyArray(int[] shape)Instantiate the result numpy array.abstract ObjectreduceAxisValues(Object[] valuesInAxis)The core operation that does the aggregation.
-
-
-
Method Detail
-
apply
public NumpyArray<OutputType> apply(NumpyArray<InputType> array, int axis, boolean keepDimensions)
Applies the operation on the numpy array.- Parameters:
array- Input array to perform operation on.axis- The axis that should be reduced on.keepDimensions- A flag indicating to keep the same number of dimension as the input.- Returns:
- The numpy array that contains the result of the reduction.
-
createInstanceResultNumpyArray
public NumpyArray<OutputType> createInstanceResultNumpyArray(int[] shape)
Instantiate the result numpy array.- Parameters:
shape- The shape of the desired array.- Returns:
- An empty array with the desired specifications.
-
-