README
dm_utils is a utility for Data Mining.
Installation
pip install dm_utils
Usage
dm_utils.hom: hold-out method
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from dm_utils.hom import HOM
x, y = load_iris(return_X_y=True, as_frame=True)
xtrain, xtest, ytrain, ytest = train_test_split(x, y, test_size=0.2, random_state=42)
# classification task, xgboost and lightgbm model
hom = HOM(task='cls', model=['xgb', 'lgb'])
hom.fit(xtrain, ytrain, record_time=True)
ypred = (hom.predict(xtest) > 0.5).argmax(axis=1)
print(accuracy_score(ypred, ytest))
dm_utils.oof: out of fold prediction
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from dm_utils.oof import OOF
x, y = load_breast_cancer(return_X_y=True, as_frame=True)
xtrain, xtest, ytrain, ytest = train_test_split(x, y, test_size=0.2, random_state=42)
# classification task, 2*xgboost, 2*lightgbm and 1*catboost model for 5-fold oof
oof = OOF(task='cls', model=['xgb', 'xgb', 'lgb', 'lgb', 'cb'])
oof.fit(xtrain, ytrain, record_time=True)
ypred = oof.predict(xtest) > 0.5
print(accuracy_score(ypred, ytest))
Features
support algorithm: scikit-learn, xgboost, lightgbm, catboost, ngboost and pytorch-tabnet
Metadata
Release files for dm-utils 0.1.1
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 |
|---|---|---|---|---|
| dm_utils-0.1.1.tar.gz | 18.7 kB | Without provenance | Details for dm_utils-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dm_utils-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for dm_utils-0.1.1-py3-none-any.whl |
Total release size: 43.6 kB
Release files / dm_utils-0.1.1.tar.gz
| Download URL | dm_utils-0.1.1.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c9744519ef90745bef28d11b64cc4e25c3ea0be729b1e99c906eddf7f129e79
|
|
BLAKE2b-256 checksum How to use checksums |
2642e0eb2cb15a61705e72a6fec8150e9f3c256772633a44187a530873f34367
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.13
|
Release files / dm_utils-0.1.1-py3-none-any.whl
| Download URL | dm_utils-0.1.1-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
868b8bb469e1a2bb79645d7da2427537f0160f4523a5fbea135f01427d5d49db
|
|
BLAKE2b-256 checksum How to use checksums |
c83d8199c9789fc1809dd3fa4dc0f45e46f370ea3c4b19bf150a674282545b95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.13
|
Security for dm-utils 0.1.1
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.