Skip to content

strata.utils

64-bit SplitMix64 PRNG with Lemire unbiased sampling, mathematical activations (softmax, sigmoid, log_sum_exp), and validation helpers.


Struct Description
PRNG 64-bit SplitMix64 pseudo-random number generator with unbiased range generation.
NotFittedError Exception raised when an estimator is used before calling fit.
DimensionMismatchError Exception raised when input matrix/vector dimensions do not match requirements.
ConvergenceError Exception raised when iterative optimization fails to converge within max iterations.
InvalidParameterError Exception raised when an invalid hyperparameter value is supplied.
DataConversionError Exception raised when data type conversion or matrix array formatting fails.
Function Description
permutation Generates a pseudo-random permutation of range(0, n) using Fisher-Yates shuffle.
shuffle In-place Fisher-Yates shuffle on a List.
sigmoid Compute the logistic sigmoid function σ(x)\sigma(x).
softmax Compute numerically stable softmax probability distribution.
log_sum_exp Compute numerically stable log-sum-exp: LSE(x)=ln⁡∑iexi\text{LSE}(x) = \ln \sum_i e^{x_i}.
check_is_fitted —
check_floating_dtype Asserts at compile time that the specified dtype is a floating-point type.
check_array —
check_X_y —
check_finite Rejects NaN and infinite entries in a target or prediction list.
check_consistent_length —
check_sparse Validates CSR/CSC sparse matrix format invariants.