-
Notifications
You must be signed in to change notification settings - Fork 0
Home
torml edited this page Sep 25, 2026
·
4 revisions
torml is a scikit-learn-style machine learning library implemented from
scratch with PyTorch (torch.Tensor, torch.linalg)
as its numerical backend, instead of NumPy/SciPy.
- Repository: https://github.com/ms-kumar/torml
- License: MIT
- Release notes:
RELEASES.md - Contributing:
CONTRIBUTING.md - Security:
SECURITY.md— report vulnerabilities privately
pip install -e .
pip install -e ".[test]" # pytest
pip install -e ".[doc]" # sphinx docsWith uv:
uv sync --extra dev --extra test
uv run pytest
uv run pre-commit run --all-filesimport torch
from torml.linear_model import LinearRegression
X = torch.randn(50, 3)
y = X @ torch.tensor([1.0, 2.0, -1.0]) + 0.1
model = LinearRegression().fit(X, y)
model.predict(X[:5])| Module | Status | Contents |
|---|---|---|
torml.base |
done (Phase 1) |
BaseEstimator, clone, mixins, check_estimator
|
torml.utils |
done (Phase 1) | validation, random state, tags, masks |
torml.metrics |
done (Phase 2) |
accuracy_score, mean_squared_error, r2_score
|
torml.linear_model |
done (Phase 2) |
LinearRegression, LogisticRegression
|
torml.model_selection |
done (Phase 2) |
train_test_split, KFold, cross_val_score
|
torml.preprocessing |
done (Phase 2) |
StandardScaler, MinMaxScaler, LabelEncoder, OneHotEncoder
|
torml.neighbors |
done |
KNeighborsClassifier, KNeighborsRegressor
|
torml.naive_bayes |
done | GaussianNB |
torml.cluster |
done |
KMeans, DBSCAN
|
torml.tree |
done |
DecisionTreeClassifier, DecisionTreeRegressor
|
torml.decomposition |
done | PCA |
torml.ensemble |
done |
VotingClassifier/Regressor, BaggingClassifier/Regressor, RandomForestClassifier/Regressor
|
torml.svm |
done |
LinearSVC, LinearSVR
|
torml.pipelines |
done |
Pipeline, FeatureUnion, ColumnTransformer
|
torml.manifold |
done | MDS |
torml.gaussian_process |
done | GaussianProcessRegressor |
torml.mixture |
done | GaussianMixture |
torml.multiclass |
done | OneVsRestClassifier |
torml.semi_supervised |
done | LabelPropagation |
torml.covariance |
done | EmpiricalCovariance |
torml.cross_decomposition |
done | PLSRegression |
torml.feature_extraction |
done | DictVectorizer |
torml.feature_selection |
done |
SelectKBest, f_classif
|
torml.random_projection |
done | GaussianRandomProjection |
torml.discriminant_analysis |
done | LinearDiscriminantAnalysis |
torml.multivariate |
done |
MultiOutputRegressor, MultiOutputClassifier
|
285 tests, CI + Tests green on main. Release v0.1.0.
-
main— integration (CI green, v0.1.0 released). -
Phase0— repo scaffold milestone (frozen). -
Phase1—base+utilsmilestone (frozen). -
Phase2— first vertical slice milestone (frozen). -
Phase3— full backlog milestone (merged tomain).
Each phase builds on the previous one: Phase0 ⊂ Phase1 ⊂ Phase2 ⊂ Phase3.
Each phase builds on the previous one: Phase0 ⊂ Phase1 ⊂ Phase2 ⊂ Phase3.
-
Estimator conventions —
fit/predict/transform/score, hyperparameters vs learned attributes. -
Validation utilities —
check_array,check_X_y,check_is_fitted,check_random_state.