Skip to content

Validation utilities

torml edited this page Sep 24, 2026 · 1 revision

Validation utilities

Shared helpers in torml.utils (all torch-backed):

  • check_array — dtype (torch.dtype or "float32" string), ensure_2d, allow_nd, copy, force_all_finite, min samples/features, device preservation.
  • check_X_y — paired validation with equal-length enforcement.
  • check_is_fitted — raises NotFittedError (a ValueError) when fitted attributes (coef_, intercept_, labels_, classes_) are missing.
  • check_random_state — None / int / torch.Generator → generator.
  • check_scalar — type + bounds checking for hyperparameters.

Clone this wiki locally