-
Notifications
You must be signed in to change notification settings - Fork 0
Estimator conventions
torml edited this page Sep 24, 2026
·
1 revision
Followed from scikit-learn, per TORML_CODING_GUIDELINES.md:
- Hyperparameters go in
__init__only and are stored unchanged onself. -
fitreturnsself. - Learned attributes end with
_(coef_,classes_,n_features_in_). - Validate inputs through
torml.utils(check_array,check_X_y). -
get_params/set_paramsround-trip;clonerebuilds an unfitted copy. - Mixins provide
score(ClassifierMixin→ accuracy,RegressorMixin→ R²),fit_transform(TransformerMixin),fit_predict(ClusterMixin). - Use vectorized PyTorch ops; no NumPy/SciPy/sklearn imports in library code.
-
torch.testing.assert_closefor tensor comparisons in tests.