Metadata-Version: 2.1
Name: trane
Version: 0.7.0
Summary: automatically generate prediction problems and labels for supervised learning.
Author-email: MIT Data to AI Lab <dai-lab-trane@mit.edu>
Maintainer-email: MIT Data to AI Lab <dai-lab-trane@mit.edu>
License: MIT License
Project-URL: Source Code, https://github.com/trane-dev/Trane/
Project-URL: Changes, https://github.com/trane-dev/Trane/blob/main/docs/changelog.md
Project-URL: Issue Tracker, https://github.com/trane-dev/Trane/issues
Project-URL: Twitter, https://twitter.com/lab_dai
Project-URL: Chat, https://join.slack.com/t/trane-dev/shared_invite/zt-1zglnh25c-ryuQFarw0rVgKHC6ywUOlg
Keywords: trane,data science,machine learning
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Requires-Python: <4,>=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: trane/datasets/data/store/LICENSE
Requires-Dist: numpy >=1.24.2
Requires-Dist: pandas >=2.0.1
Requires-Dist: scipy >=1.10.0
Requires-Dist: tqdm >=4.65.0
Requires-Dist: importlib-resources >=6.0.0
Requires-Dist: pyarrow >=11.0.0
Provides-Extra: dev
Requires-Dist: ruff >=0.1.0 ; extra == 'dev'
Requires-Dist: black[jupyter] >=22.12.0 ; extra == 'dev'
Requires-Dist: pre-commit ==2.20.0 ; extra == 'dev'
Requires-Dist: toml >=0.10.2 ; extra == 'dev'
Provides-Extra: llm
Requires-Dist: openai >=0.28.1 ; extra == 'llm'
Requires-Dist: tiktoken >=0.5.1 ; extra == 'llm'
Provides-Extra: test
Requires-Dist: pytest >=3.4.2 ; extra == 'test'
Requires-Dist: pytest-cov >=2.5.1 ; extra == 'test'
Requires-Dist: pytest-xdist >=3.1.0 ; extra == 'test'
Requires-Dist: pytest-runner >=2.11.1 ; extra == 'test'


<p align="center">
<img width=50% src="https://github.com/trane-dev/Trane/blob/main/docs/trane-header.png" alt="Trane Logo" />
</p>

<p align="center">
    <a href="https://github.com/trane-dev/Trane/actions/workflows/tests.yaml" target="_blank">
      <img src="https://github.com/trane-dev/Trane/actions/workflows/tests.yaml/badge.svg" alt="Tests Status" />
    </a>
    <a href="https://codecov.io/gh/trane-dev/Trane" target="_blank">
      <img src="https://codecov.io/gh/trane-dev/Trane/branch/main/graph/badge.svg?token=HafAlYGH8F" alt="Code Coverage" />
    </a>
    <a href="https://badge.fury.io/py/Trane" target="_blank">
        <img src="https://badge.fury.io/py/Trane.svg?maxAge=2592000" alt="PyPI Version" />
    </a>
    <a href="https://pepy.tech/project/Trane" target="_blank">
        <img src="https://static.pepy.tech/badge/trane" alt="PyPI Downloads" />
    </a>
</p>

<hr>

**Trane** is a software package that automatically generates problems for temporal datasets and produces labels for supervised learning. Its goal is to streamline the machine learning problem-solving process.

## Install

Install Trane using pip:

```shell
python -m pip install trane
```

## Usage 

Here's a quick demonstration of Trane in action:

```python
import trane

data, metadata = trane.load_airbnb()
entity_columns = ["location"]
window_size = "2d"

problem_generator = trane.ProblemGenerator(
    metadata=metadata,
    window_size=window_size,
    entity_columns=entity_columns
)
problems = problem_generator.generate()

print(f'Generated {len(problems)} problems.')
print(problems[108])
print(problems[108].create_target_values(data).head(5))
```

Output:

```
Generated 168 problems.
For each <location> predict the majority <rating> in all related records in the next 2 days.
  location       time  target
0   London 2021-01-01       5
1   London 2021-01-03       4
2   London 2021-01-05       5
3   London 2021-01-07       4
4   London 2021-01-09       5
```

## Community

- **Questions or Issues?** Create a [GitHub issue](https://github.com/trane-dev/Trane/issues).
- **Want to Chat?** [Join our Slack community](https://join.slack.com/t/trane-dev/shared_invite/zt-1zglnh25c-ryuQFarw0rVgKHC6ywUOlg).

## Cite Trane

If you find Trane beneficial, consider citing our paper:

Ben Schreck, Kalyan Veeramachaneni. [What Would a Data Scientist Ask? Automatically Formulating and Solving Predictive Problems.](https://dai.lids.mit.edu/wp-content/uploads/2017/10/Trane1.pdf) *IEEE DSAA 2016*, 440-451.

BibTeX entry:

```bibtex
@inproceedings{schreck2016would,
  title={What Would a Data Scientist Ask? Automatically Formulating and Solving Predictive Problems},
  author={Schreck, Benjamin and Veeramachaneni, Kalyan},
  booktitle={Data Science and Advanced Analytics (DSAA), 2016 IEEE International Conference on},
  pages={440--451},
  year={2016},
  organization={IEEE}
}
```
