mlutil
Utilities for ML models.
Whenever possibles, modules are made to be compatible with scikit-learn.
Installation
pip install mlutil
Modules
eval(cross-validation)model(ML models)transform(feature transformers)tune(TBD: ML model tuning)
Eval
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import cross_validate
from mlutil.eval import TimeSeriesSplit
X = np.vstack([np.random.normal(size=100), np.random.normal(size=100)]).T
y = np.random.normal(size=100)
m = LinearRegression()
cv = TimeSeriesSplit(test_size=50)
scores = cross_validate(m, X, y, scoring=["neg_mean_squared_error"], cv=cv)
Model
import numpy as np
from mlutil.model import GAM
m = GAM(n_splines=5)
X = np.arange(20)[:, None]
y = np.arange(20) + np.random.normal(scale=0.1, size=20)
m.fit(X, y)
X_test = np.arange(15, 25)[:, None]
y_test = np.arange(15, 25)
y_hat = m.predict(X_test)
np.testing.assert_allclose(y_test, y_hat, atol=1.0)
m.summary()
Transform
import numpy as np
import pandas as pd
from mlutil.transform import ColumnSelector, SigmaClipper
X = pd.DataFrame({
"a": [np.nan, -1.0, 2.0, 1.0, 1.0, 302.0],
"b": [-2.0, 1.0, 3.0, 2.0, -201, np.nan],
})
t = ColumnSelector(SigmaClipper(low_sigma=3, high_sigma=3))
X_new_ = t.fit_transform(X)
Metadata
Release files for mlutil 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mlutil-0.1.15.tar.gz | 16.1 kB | Without provenance | Details for mlutil-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mlutil-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for mlutil-0.1.15-py3-none-any.whl |
Total release size: 34.7 kB
Release files / mlutil-0.1.15.tar.gz
| Download URL | mlutil-0.1.15.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bbf7168adb963e6dea2aad4b828883224e15e41f5bcbd9c3b21c795dc19b193
|
|
BLAKE2b-256 checksum How to use checksums |
9e6d4bd4b7ece6778bba7401f53df1443763eb6af9b3dda12e30053e8defdd0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.14
|
Release files / mlutil-0.1.15-py3-none-any.whl
| Download URL | mlutil-0.1.15-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45b800f0f8a6690faf9d7a8476a5121a18eccffbbce997bfa122f0566bd380fe
|
|
BLAKE2b-256 checksum How to use checksums |
e7da2c7cb35fe465db69e9d8d7d174a3f20c7cc54dcf853853fab6d1a515effe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.14
|
Security for mlutil 0.1.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.