Utilitaires ML légers : normalisation, split, encodage, standardisation
Project description
mltools
Utilitaires ML légers : normalisation, train/test split, encodage one-hot, standardisation.
Auteur : Mouhamed Diouf
Installation
pip install mltools-mouhameddiouf
Utilisation
import numpy as np
from mltools import normalize, train_test_split, one_hot_encode, standardize
# Normalisation min-max (entre 0 et 1)
X = np.array([[1, 2], [3, 4], [5, 6]])
X_norm = normalize(X)
# Standardisation (moyenne 0, écart-type 1)
X_std = standardize(X)
# Découpage train/test
y = np.array([0, 1, 0])
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33)
# Encodage one-hot des labels
y_oh = one_hot_encode(y)
Fonctions disponibles
| Fonction | Description |
|---|---|
normalize(X) |
Min-max scaling entre 0 et 1 |
standardize(X) |
Standardisation (moyenne 0, écart-type 1) |
train_test_split(X, y, test_size, random_state) |
Découpe train/test |
one_hot_encode(y) |
Encodage one-hot d'un vecteur de labels |
Développement
# Installer en mode éditable avec les extras dev
pip install -e ".[dev]"
# Lancer les tests
pytest tests/ -v --cov=src/mltools
# Vérifier le style
ruff check src/
# Vérifier les types
mypy src/mltools/
Licence
MIT — voir le fichier LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mltools_mouhameddiouf-0.2.0.tar.gz.
File metadata
- Download URL: mltools_mouhameddiouf-0.2.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b70dfddb8e88e073cdb48d4a722dac83d689b603c83415cb7ab84bf80854cd08
|
|
| MD5 |
a4511f942663e279ddbc7e05886f2956
|
|
| BLAKE2b-256 |
6222bc79728f0e352db7c723b87c6cb691982cad6139e147ff1d373a448d3928
|
File details
Details for the file mltools_mouhameddiouf-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mltools_mouhameddiouf-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a860bd61491c0338a1f7d2773b53425a298c98ecffa55e19730ed9cef02eebc1
|
|
| MD5 |
5103fa23153cc8b7d590c0af09f3e58d
|
|
| BLAKE2b-256 |
f0f027f76cc6b1a0c77071ae809c1c8da436f2bc2bb30d3c221f6b24912afedc
|