Skip to main content

Crate aocl_data_analytics

Crate aocl_data_analytics 

Source
Expand description

Safe wrappers for AOCL-DA (Data Analytics).

Structs§

Datastore
RAII wrapper around da_datastore — AOCL-DA’s container for tabular data loaded from CSV. Use it to read a file, query its dimensions, label or select columns by name, and extract numeric blocks into caller-provided buffers.
Dbscan
DBSCAN density-based clustering. Unlike k-means it does not require the number of clusters in advance and can mark points as noise (label -1).
DecisionForest
A random-forest classifier. Configure forest options such as "number of trees" or "bootstrap" via DecisionForest::handle_mut before calling DecisionForest::fit.
DecisionTree
A single decision tree classifier. Configure tree-specific options such as "maximum depth" or "minimum samples per split" via DecisionTree::handle_mut before calling DecisionTree::fit.
Handle
RAII wrapper around da_handle. Tracks the algorithm and precision chosen at construction time.
KMeans
k-means clustering wrapper. Holds an Handle specialised for da_handle_kmeans and exposes the typical fit/predict interface.
KNearestNeighbours
k-nearest-neighbours classifier.
Linmod
Linear-model wrapper covering least-squares (MSE) regression and logistic regression. Use Linmod::fit to fit the model on training data, then Linmod::coefficients to inspect the fitted weights or Linmod::predict / Linmod::evaluate to apply the model.
Nlls
Nonlinear least-squares solver wrapping AOCL’s RAlfit family.
Pca
Principal Component Analysis. Reduces an n_samples × n_features matrix to a lower-dimensional representation.
Svm
Support vector machine wrapper covering both classification (Svc, NuSvc) and regression (Svr, NuSvr) modes. Configure SVM-specific options (kernel, C, epsilon, gamma, …) via Svm::handle_mut before calling Svm::fit.

Enums§

Axis
Reduction axis: per-column, per-row, or global.
DecisionShape
Decision-function shape used for multi-class classification.
Error
Errors that can be returned by safe AOCL wrappers.
HandleKind
Type of analytics handle. AOCL-DA uses an opaque handle to track the state of an algorithm (data, options, fitted model, predictions).
Layout
Storage order of a 2-D matrix.
LinmodKind
Family of linear model handled by Linmod.
Metric
Distance metric for pairwise_distances.
Precision
Internal precision selector for Handle: f64 (Double) or f32 (Single). The choice determines which underlying da_*_d / da_*_s C entry points are used.
QuantileType
Method used for quantile computation. Each variant matches one of the nine standard quantile types (Hyndman & Fan 1996); types 6 and 7 are the most commonly used.
SvmKind
Family of SVM model. Classification variants train against integer class labels (passed as f64); regression variants train against a real-valued response.

Traits§

DistScalar
Scalar element type usable with pairwise_distances.
KernelScalar
Scalar element type for kernel-matrix computations.
Scalar
Scalar element type usable with the wrapped DA routines.

Functions§

correlation_matrix
Compute the n_cols × n_cols correlation matrix (rows are observations).
covariance_matrix
Compute the n_cols × n_cols covariance matrix (rows are observations). dof follows the same convention as variance.
five_point_summary
Compute Tukey’s five-number summary (min, lower hinge, median, upper hinge, max) along axis.
geometric_mean
Compute the geometric mean along axis for a tightly-packed row-major matrix. All entries must be non-negative.
harmonic_mean
Compute the harmonic mean along axis for a tightly-packed row-major matrix.
kurtosis
Compute means, variances, and excess kurtosis (Fisher convention, so a normal distribution scores zero) along axis.
linear_kernel
Linear kernel K(x, y) = x · y between rows of row-major matrices x (m × k) and optionally y (n × k). Output d is m × n (or m × m if y is None).
mean
Compute the mean of a tightly-packed row-major matrix along axis.
moment
Compute the k-th central moment along axis. If mean_out already holds means and use_precomputed_mean is true, those are used directly; otherwise means are computed and stored.
pairwise_distances
Compute the pairwise distance matrix between rows of x (and optionally rows of y) under the given metric.
polynomial_kernel
Polynomial kernel K(x, y) = (γ · x · y + c)^degree (row-major).
quantile
Compute the q-th quantile along axis (q ∈ [0, 1]). The qtype selects one of the nine standard quantile formulae; QuantileType::Type7 matches numpy and R’s defaults.
rbf_kernel
RBF kernel K(x, y) = exp(-γ · ‖x − y‖²) (row-major).
sigmoid_kernel
Sigmoid kernel K(x, y) = tanh(γ · x · y + c) (row-major).
skewness
Compute means, variances, and Fisher–Pearson skewness along axis.
variance
Compute mean and variance of a tightly-packed row-major matrix along axis.

Type Aliases§

JacFn
Type-erased Jacobian closure: writes the n_res × n_coef Jacobian of the residuals at x into jac. Layout matches the AOCL "storage scheme" option (defaults to row-major). Return 0 on success.
ResFn
Type-erased residual closure: maps coefficients x of length n_coef to residuals res of length n_res. Return 0 on success or non-zero to signal an evaluation failure (the solver will return an error).
Result
Crate result alias — used by every aocl-* safe wrapper crate.