Result Extraction APIs#

da_status da_handle_get_result_int(const da_handle handle, da_result query, da_int *dim, da_int *result)#
da_status da_handle_get_result_s(const da_handle handle, da_result query, da_int *dim, float *result)#
da_status da_handle_get_result_d(const da_handle handle, da_result query, da_int *dim, double *result)#

Get results stored in a da_handle.

Some solvers will store relevant data in the handle. These functions provide a means to extract it. To check the available data stored by a given API check its associated documentation.

Parameters
  • handle – a valid handle used to call any of the solvers.

  • query – the data of interest, see da_result. If the result is not available or not found in the handle then the function returns da_status_unknown_query.

  • dim – the size of the array result. If dim is too small, then on exit it will be overwritten with the correct size and the function will return da_status_invalid_array_dimension.

  • result – location of the array in which to store the data.

Returns

da_status. The function returns:

  • da_status_success - the operation completed successfully.

  • da_status_unknown_query - the query is either not available or not found in the handle. This can happen if you try an extract a result before performing the operation (for example, extracting the coefficient of a linear regression before actually performing a successful fit), or if the handle is of the wrong type (for example, a handle initialized for linear models cannot contain results about a principal component analysis).

  • da_status_wrong_type - the floating point precision used to initialize the handle does not match the precision of result.

  • da_status_handle_not_initialized - the handle has not been initialized or is corrupted.

  • da_status_invalid_array_dimension - the size dim of the result array is too small. After the call dim contains the correct size.

  • da_status_invalid_pointer - the pointer to handle is invalid.

da_result enums#

typedef enum da_result_ da_result#

Alias for the da_result_ enum.

enum da_result_#

Enumeration defining which result to extract from a handle.

Values:

enumerator da_rinfo#

General information array, containing a variety of metrics. See each solver’s documentation for further information, since each solver stores different information in this array.

enumerator da_linmod_coef#

Optimal fitted coefficients produced by the last call to a linear regression solver.

enumerator da_pca_scores#

Matrix of scores computed by the PCA API.

enumerator da_pca_variance#

The variance explained by each component computed by the PCA API.

enumerator da_pca_principal_components#

Matrix of principal components computed by the PCA API.

enumerator da_pca_total_variance#

The total variance of the data matrix supplied to the PCA API.

enumerator da_pca_column_means#

Column means of the data matrix supplied to the PCA API.

enumerator da_pca_column_sdevs#

Column standard deviations of the data matrix supplied to the PCA API.

enumerator da_pca_u#

The matrix \(U\) from the singular value decomposition \(A = U\Sigma V^T\), computed as part of a PCA computation.

enumerator da_pca_sigma#

The nonzero diagonal entries of \(\Sigma\) from the singular value decomposition \(A = U\Sigma V^T\), computed as part of a PCA computation.

enumerator da_pca_vt#

The matrix \(V^T\) from the singular value decomposition \(A = U\Sigma V^T\), computed as part of a PCA computation.

enumerator da_kmeans_cluster_centres#

Matrix of cluster centres computed in k-means clustering.

enumerator da_kmeans_labels#

Labels of samples in the data matrix used to compute k-means clustering.

enumerator da_knn_model_params#

Model parameters for the trained and fitted k-nearest neighbors.