Skip to main content

A Train Test Val Split library

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ttvsplit-0.3.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ttvsplit-0.3-py3-none-any.whl (1.7 kB view details)

Uploaded Python 3

File details

Details for the file ttvsplit-0.3.tar.gz.

File metadata

  • Download URL: ttvsplit-0.3.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for ttvsplit-0.3.tar.gz
Algorithm Hash digest
SHA256 31119adf9399566cf887a376f5e5aaf59f1b5dc8610550370bc4b22a851c12b9
MD5 c7aed461978b7c6659e2286e702614f8
BLAKE2b-256 3688e19dfdb955a5c1f49d9dc838e26343ca238835b7247ae713aea42b241dd3

See more details on using hashes here.

File details

Details for the file ttvsplit-0.3-py3-none-any.whl.

File metadata

  • Download URL: ttvsplit-0.3-py3-none-any.whl
  • Upload date:
  • Size: 1.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for ttvsplit-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fae204d53680fcd97a9c27b625806a0c88be4eaf6c6751659afabe3065d7bfde
MD5 3d3567f77345e709bec0f9745c9563ba
BLAKE2b-256 78a10b13b2171f68efd36c3bb2a150f325d69d93526ac859ba301e69da1123ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page