Sorting
In oneDAL sorting is an algorithm to sort the observations by each feature (column) in the ascending order.
The result of the sorting algorithm applied to the matrix
is the matrix
where the
,
,
j
-th column
i = 1, …, n
,
is the column
i = 1, …, n
, sorted in the ascending order.Batch Processing
Algorithm Input
The sorting algorithm accepts the input described below.
Pass the
Input ID
as a parameter to the methods that provide input for your algorithm.
For more details, see Algorithms.Input ID | Input |
---|---|
data | Pointer to the
This table can be an object of any class derived from NumericTable except
PackedSymmetricMatrix , PackedTriangularMatrix , and CSRNumericTable . |
Algorithm Parameters
The sorting algorithm has the following parameters:
Parameter | Default Value | Description |
---|---|---|
algorithmFPType | float | The floating-point type that the algorithm uses for intermediate computations. Can be float or double . |
method | defaultDense | The radix method for sorting a data set, the only method supported by the algorithm. |
Algorithm Output
The sorting algorithm function calculates the result described below.
Pass the
Result ID
as a parameter to the methods that access the results of your algorithm.
For more details, see Algorithms.Result ID | Result |
---|---|
sortedData | Pointer to the
|
If the number of feature vectors is greater than or equal to
,
the library uses the quick sort method instead of radix sort.
Examples
C++ (CPU)
Batch Processing:
Java*
Python*
Batch Processing: