pactus

pactus: A Python framework for trajectory classification - Published in JOSS (2023)

https://github.com/yupidevs/pactus

Science Score: 98.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 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

classification classification-models evaluation-framework python trajectory trajectory-analysis transformers
Last synced: 4 months ago · JSON representation ·

Repository

Framework to evaluate Trajectory Classification Algorithms

Basic Info
  • Host: GitHub
  • Owner: yupidevs
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.17 MB
Statistics
  • Stars: 46
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 14
Topics
classification classification-models evaluation-framework python trajectory trajectory-analysis transformers
Created about 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

pactus

Standing from Path Classification Tools for Unifying Strategies, pactus is a Python library that allows testing different classification methods on several trajectory datasets.

It comes with some built-in models and datasets according to the state-of-the-art in trajectory classification. However, it is implemented in an extensible way, so the users can build their own models and datasets.

NOTE: Built-in datasets don't contain the raw trajectoy data. When a dataset is loaded for the first time it downloads the necessary data automatically.

Installation

Make sure you have a Python interpreter newer than version 3.8:

bash ❯ python --version Python 3.8.0

Then, you can simply install pactus from pypi using pip:

bash pip install pactus

Getting started

This is quick example of how to test a Random Forest classifier on the Animals dataset:

```python from pactus import Dataset, featurizers from pactus.models import RandomForestModel

SEED = 0

Load dataset

dataset = Dataset.animals()

Split data into train and test subsets

train, test = dataset.split(0.9, random_state=SEED)

Convert trajectories into feature vectors

ft = featurizers.UniversalFeaturizer()

Build and train the model

model = RandomForestModel(featurizer=ft, randomstate=SEED) model.train(train, crossvalidation=5)

Evaluate the results on the test subset

evaluation = model.evaluate(test) evaluation.show() ```

It should produce an output as the following:

```text General statistics:

Accuracy: 0.885 F1-score: 0.849 Mean precision: 0.865 Mean recall: 0.850

Confusion matrix:

Cattle Deer Elk precision

75.0 0.0 0.0 100.0 25.0 80.0 0.0 66.67

0.0 20.0 100.0 92.86

75.0 80.0 100.0 ```

ℹ️ Notice that by setting the random state to a fixed seed, we ensure the reproducibility of the results. By changing the seed value, results may be slightly different due to the stochastic processes used when splitting the dataset and training the model.

Available datasets

See the whole list of datasets compatible with pactus

Contributing

Follow the guidlines from pactus documentation

Owner

  • Name: yupidevs
  • Login: yupidevs
  • Kind: organization

JOSS Publication

pactus: A Python framework for trajectory classification
Published
September 22, 2023
Volume 8, Issue 89, Page 5738
Authors
G. Viera-López ORCID
Department of Computer Science, Gran Sasso Science Institute, L'Aquila, Italy
J.j. Morgado-Vega ORCID
Department of Artificial Intelligence, University of Havana, Havana, Cuba
A. Reyes ORCID
Group of Complex Systems and Statistical Physics, University of Havana, Havana, Cuba
E Altshuler ORCID
Group of Complex Systems and Statistical Physics, University of Havana, Havana, Cuba
Yudivián Almeida-Cruz ORCID
Department of Artificial Intelligence, University of Havana, Havana, Cuba
Giorgio Manganini ORCID
Department of Computer Science, Gran Sasso Science Institute, L'Aquila, Italy
Editor
Arfon Smith ORCID
Tags
trajectory classification mobility data machine learning

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Viera-López
  given-names: G.
  orcid: "https://orcid.org/0000-0002-9661-5709"
- family-names: Morgado-Vega
  given-names: J. J.
  orcid: "https://orcid.org/0000-0001-6067-9172"
- family-names: Reyes
  given-names: A.
  orcid: "https://orcid.org/0000-0001-7305-4710"
- family-names: Altshuler
  given-names: E.
  orcid: "https://orcid.org/0000-0003-4192-5635"
- family-names: Almeida-Cruz
  given-names: Yudivián
  orcid: "https://orcid.org/0000-0002-2345-1387"
- family-names: Manganini
  given-names: Giorgio
  orcid: "https://orcid.org/0000-0002-5394-4094"
contact:
- family-names: Viera-López
  given-names: G.
  orcid: "https://orcid.org/0000-0002-9661-5709"
doi: 10.5281/zenodo.8352324
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Viera-López
    given-names: G.
    orcid: "https://orcid.org/0000-0002-9661-5709"
  - family-names: Morgado-Vega
    given-names: J. J.
    orcid: "https://orcid.org/0000-0001-6067-9172"
  - family-names: Reyes
    given-names: A.
    orcid: "https://orcid.org/0000-0001-7305-4710"
  - family-names: Altshuler
    given-names: E.
    orcid: "https://orcid.org/0000-0003-4192-5635"
  - family-names: Almeida-Cruz
    given-names: Yudivián
    orcid: "https://orcid.org/0000-0002-2345-1387"
  - family-names: Manganini
    given-names: Giorgio
    orcid: "https://orcid.org/0000-0002-5394-4094"
  date-published: 2023-09-22
  doi: 10.21105/joss.05738
  issn: 2475-9066
  issue: 89
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 5738
  title: "pactus: A Python framework for trajectory classification"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.05738"
  volume: 8
title: "pactus: A Python framework for trajectory classification"

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 160
  • Total Committers: 2
  • Avg Commits per committer: 80.0
  • Development Distribution Score (DDS): 0.081
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jorge Morgado Vega j****v@g****m 147
Gustavo Viera López g****z 13

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 36 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 15
  • Total maintainers: 1
pypi.org: pactus

Framework to evaluate Trajectory Classification Algorithms

  • Homepage: https://github.com/yupidevs/pactus
  • Documentation: https://pactus.readthedocs.io/
  • License: MIT License Copyright (c) 2022 yupidevs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.4.3
    published over 1 year ago
  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 36 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 12.0%
Average: 20.3%
Stargazers count: 21.8%
Forks count: 30.5%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 4 months ago

Dependencies

.github/workflows/set-version.yml actions
  • EndBug/add-and-commit v9 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • ncipollo/release-action v1 composite
.github/workflows/draf-pdf.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
.github/workflows/tests.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
docs/requirements.txt pypi
  • GitPython *
  • numpy *
  • scikit-learn *
  • tensorflow *
  • xgboost *
  • yupi *
pyproject.toml pypi
  • GitPython >= 3.1.29
  • numpy >= 1.23.5
  • requests >= 2.32.3
  • scikit-learn >= 1.1.1
  • tensorflow >= 2.12.0
  • xgboost >= 1.7.4
  • yupi >= 0.11.2