panelsplit

A tool for performing cross-validation with panel data

https://github.com/4freye/panelsplit

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary

Keywords

cross-validation pandas panel-data python sklearn-compatible time-series
Last synced: 6 months ago · JSON representation ·

Repository

A tool for performing cross-validation with panel data

Basic Info
  • Host: GitHub
  • Owner: 4Freye
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 7.66 MB
Statistics
  • Stars: 20
  • Watchers: 1
  • Forks: 2
  • Open Issues: 3
  • Releases: 7
Topics
cross-validation pandas panel-data python sklearn-compatible time-series
Created about 2 years ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.md

PyPI - Version DOI

PanelSplit: a tool for panel data analysis

PanelSplit is a Python package designed to facilitate time series cross-validation when working with multiple entities (aka panel data). This tool is useful for handling panel data in various stages throughout the data pipeline, including feature engineering, hyper-parameter tuning, and model estimation.

Installation

You can install PanelSplit using pip:

```bash pip install panelsplit

```

Documentation

To read the documentation, visit here.

Example Usage

```python import pandas as pd from panelsplit import PanelSplit

Generate example data

numcountries = 2 years = range(2001, 2004) numyears = len(years)

datadict = { 'countryid': [c for c in range(1, numcountries + 1) for _ in years], 'year': [year for _ in range(numcountries) for year in years], 'y': np.random.normal(0, 1, numcountries * numyears), 'x1': np.random.normal(0, 1, numcountries * numyears), 'x2': np.random.normal(0, 1, numcountries * numyears) }

paneldata = pd.DataFrame(datadict) panelsplit = PanelSplit(periods = paneldata.year, n_splits =2)

splits = panel_split.split()

for trainidx, testidx in splits: print("Train:"); display(paneldata.loc[trainidx]) print("Test:"); display(paneldata.loc[testidx]) ```

For more examples and detailed usage instructions, refer to the examples directory in this repository. Also feel free to check out an article I wrote about PanelSplit.

Background

Work on panelsplit started at EconAI in December 2023 and has been under active development since then.

Contributing

Contributions to PanelSplit are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Owner

  • Name: Eric Frey
  • Login: 4Freye
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Frey"
  given-names: "Eric"
  orcid: "https://orcid.org/0009-0003-8931-3248"
- family-names: "Seimon"
  given-names: "Ben"
  orcid: "https://orcid.org/0009-0006-2655-4097"
title: "panelsplit"
doi: 10.5281/zenodo.10777259
version: 0.4.2
date-released: 2024-6-11
url: "https://github.com/4Freye/panelsplit"

GitHub Events

Total
  • Create event: 32
  • Issues event: 6
  • Release event: 2
  • Watch event: 10
  • Delete event: 30
  • Issue comment event: 3
  • Push event: 68
  • Pull request review event: 1
  • Pull request event: 65
Last Year
  • Create event: 32
  • Issues event: 6
  • Release event: 2
  • Watch event: 10
  • Delete event: 30
  • Issue comment event: 3
  • Push event: 68
  • Pull request review event: 1
  • Pull request event: 65

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 34
  • Average time to close issues: about 6 hours
  • Average time to close pull requests: 5 minutes
  • Total issue authors: 4
  • Total pull request authors: 2
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.0
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 34
  • Average time to close issues: about 6 hours
  • Average time to close pull requests: 5 minutes
  • Issue authors: 4
  • Pull request authors: 2
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.0
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • 4Freye (3)
  • LawrentChen (2)
  • BenSeimon (1)
  • svanomm (1)
Pull Request Authors
  • 4Freye (47)
  • BenSeimon (4)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 85 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 1
pypi.org: panelsplit

A tool for panel data analysis.

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 85 Last month
Rankings
Dependent packages count: 9.8%
Average: 37.1%
Dependent repos count: 64.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi