Metadata-Version: 2.4
Name: tvtsplit
Version: 0.0.2a1
Project-URL: Documentation, https://github.com/anyumuenyumuboto/tvtsplit#readme
Project-URL: Issues, https://github.com/anyumuenyumuboto/tvtsplit/issues
Project-URL: Source, https://github.com/anyumuenyumuboto/tvtsplit
Author-email: anyumuenyumuboto <aebttkkktt@outlook.jp>
License-Expression: MIT
License-File: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: polars
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# tvtsplit

[![PyPI - Version](https://img.shields.io/pypi/v/tvtsplit.svg)](https://pypi.org/project/tvtsplit)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tvtsplit.svg)](https://pypi.org/project/tvtsplit)

-----

Split polars DataFrame into training data, validation data and test data.

## Table of Contents

- [Installation](#installation)
- [License](#license)

## Installation

```console
pip install tvtsplit
```

## Usage

```python
import polars as pl
import tvtsplit

params = {"shuffle": False, "seed": 0, "val_size": 0.25, "test_size": 0.25}
sample_df = pl.DataFrame(
    data=["aaa", "bbb", "ccc", "ddd", "eee", "fff"],
    schema=[("txt", pl.String)],
    )
```

```
print(sample_df.tvtsplit.train(params))
shape: (4, 1)
┌─────┐
│ txt │
│ --- │
│ str │
╞═════╡
│ aaa │
│ bbb │
│ ccc │
│ ddd │
└─────┘
```

```
print(sample_df.tvtsplit.val(params))
shape: (1, 1)
┌─────┐
│ txt │
│ --- │
│ str │
╞═════╡
│ eee │
└─────┘
```

```
print(sample_df.tvtsplit.test(params))
shape: (1, 1)
┌─────┐
│ txt │
│ --- │
│ str │
╞═════╡
│ fff │
└─────┘
```

## License

`tvtsplit` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
