Type aliases

The public type aliases used across the API. All are concrete typing.TypeAlias definitions over numpy / scipy.sparse types.

sparho.Scalar: TypeAlias

float | numpy.floating — a real scalar.

sparho.Array: TypeAlias

numpy.typing.NDArray[numpy.floating] — a real-valued numpy array of arbitrary shape.

sparho.Hyperparam: TypeAlias

float | Array. The outer-loop hyperparameter — a scalar (e.g. the Lasso α) or a per-feature vector (e.g. WeightedL1’s α_j).

sparho.DesignMatrix: TypeAlias

Array | scipy.sparse.csc_matrix | scipy.sparse.csc_array. CSC is the v0.1 sparse format. CSR and COO inputs are expected to be converted by the caller via .tocsc() before reaching the inner solvers.

sparho.IndexArray: TypeAlias

numpy.typing.NDArray[numpy.int32]. Index arrays (active set, fold indices). int32 to match CSC indices.