ttsvsplit - Train, Test, Validation Splitter
A simple utility designed to seamlessly split datasets into train, test, and validation sets, inspired by sklearn's train_test_split.
Installation
To install ttvsplit, use pip:
pip install ttsvsplit
Usage
Using ttvsplit is straightforward. Import the train_test_val_split function and apply it on your features (X) and labels (y).
Here's a basic example:
import numpy as np
from ttsvsplit import train_test_val_split
# Sample data
X = np.array([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12]])
y = np.array([1, 0, 1, 0, 1, 0])
X_train, y_train, X_test, y_test, X_val, y_val = train_test_val_split(X, y)
Functions
The library provides the following function:
train_test_val_split(X, y, train_size=0.6, test_size=0.2, random_state=None):- X: Features to be split.
- y: Labels corresponding to the features.
- train_size: Proportion of the data to be used as training data (default: 0.6).
- test_size: Proportion of the data to be used as testing data (default: 0.2).
- random_state: Seed for reproducibility.
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
Metadata
Release files for ttvsplit 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ttvsplit-0.3.tar.gz | 1.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ttvsplit-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.4 kB
Release files / ttvsplit-0.3.tar.gz
| Download URL | ttvsplit-0.3.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31119adf9399566cf887a376f5e5aaf59f1b5dc8610550370bc4b22a851c12b9
|
|
BLAKE2b-256 checksum How to use checksums |
3688e19dfdb955a5c1f49d9dc838e26343ca238835b7247ae713aea42b241dd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|
Release files / ttvsplit-0.3-py3-none-any.whl
| Download URL | ttvsplit-0.3-py3-none-any.whl |
|---|---|
| Size | 1.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fae204d53680fcd97a9c27b625806a0c88be4eaf6c6751659afabe3065d7bfde
|
|
BLAKE2b-256 checksum How to use checksums |
78a10b13b2171f68efd36c3bb2a150f325d69d93526ac859ba301e69da1123ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.4
|