m5py

An implementation of M5 and model trees in python, compliant with scikit-learn.

https://github.com/smarie/python-m5p

Science Score: 44.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
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.8%) to scientific vocabulary

Keywords

m5 machine-learning model prime regression scikit-learn tree
Last synced: 6 months ago · JSON representation ·

Repository

An implementation of M5 and model trees in python, compliant with scikit-learn.

Basic Info
Statistics
  • Stars: 24
  • Watchers: 2
  • Forks: 4
  • Open Issues: 10
  • Releases: 4
Topics
m5 machine-learning model prime regression scikit-learn tree
Created over 4 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation Zenodo

README.md

m5py

scikit-learn-compliant M5 / M5' model trees for python

Python versions Build Status Tests Status Coverage Status codecov Flake8 Status

Documentation PyPI Downloads Downloads per week GitHub stars

This is the readme for developers. The documentation for users is available here: https://smarie.github.io/python-m5p/

Want to contribute ?

Contributions are welcome ! Simply fork this project on github, commit your contributions, and create pull requests.

Here is a non-exhaustive list of interesting open topics: https://github.com/smarie/python-m5p/issues

nox setup

This project uses nox to define all lifecycle tasks. In order to be able to run those tasks, you should create python 3.7 environment and install the requirements:

```bash

conda create -n noxenv python="3.7" activate noxenv (noxenv) >>> pip install -r noxfile-requirements.txt ```

You should then be able to list all available tasks using:

```

nox --list Sessions defined in \noxfile.py:

  • tests-2.7 -> Run the test suite, including test reports generation and coverage reports.
  • tests-3.5 -> Run the test suite, including test reports generation and coverage reports.
  • tests-3.6 -> Run the test suite, including test reports generation and coverage reports.
  • tests-3.8 -> Run the test suite, including test reports generation and coverage reports.
  • tests-3.7 -> Run the test suite, including test reports generation and coverage reports.
  • docs-3.7 -> Generates the doc and serves it on a local http server. Pass '-- build' to build statically instead.
  • publish-3.7 -> Deploy the docs+reports on github pages. Note: this rebuilds the docs
  • release-3.7 -> Create a release on github corresponding to the latest tag ```

Running the tests and generating the reports

This project uses pytest so running pytest at the root folder will execute all tests on current environment. However it is a bit cumbersome to manage all requirements by hand ; it is easier to use nox to run pytest on all supported python environments with the correct package requirements:

bash nox

Tests and coverage reports are automatically generated under ./docs/reports for one of the sessions (tests-3.7).

If you wish to execute tests on a specific environment, use explicit session names, e.g. nox -s tests-3.6.

Editing the documentation

This project uses mkdocs to generate its documentation page. Therefore building a local copy of the doc page may be done using mkdocs build -f docs/mkdocs.yml. However once again things are easier with nox. You can easily build and serve locally a version of the documentation site using:

```bash

nox -s docs nox > Running session docs-3.7 nox > Creating conda env in .nox\docs-3-7 with python=3.7 nox > [docs] Installing requirements with pip: ['mkdocs-material', 'mkdocs', 'pymdown-extensions', 'pygments'] nox > python -m pip install mkdocs-material mkdocs pymdown-extensions pygments nox > mkdocs serve -f ./docs/mkdocs.yml INFO - Building documentation... INFO - Cleaning site directory INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration: - long_description.md INFO - Documentation built in 1.07 seconds INFO - Serving on http://127.0.0.1:8000 INFO - Start watching changes ... ```

While this is running, you can edit the files under ./docs/ and browse the automatically refreshed documentation at the local http://127.0.0.1:8000 page.

Once you are done, simply hit <CTRL+C> to stop the session.

Publishing the documentation (including tests and coverage reports) is done automatically by the continuous integration engine, using the nox -s publish session, this is not needed for local development.

Packaging

This project uses setuptools_scm to synchronise the version number. Therefore the following command should be used for development snapshots as well as official releases: python setup.py sdist bdist_wheel. However this is not generally needed since the continuous integration engine does it automatically for us on git tags. For reference, this is done in the nox -s release session.

Merging pull requests with edits - memo

Ax explained in github ('get commandline instructions'):

bash git checkout -b <git_name>-<feature_branch> main git pull https://github.com/<git_name>/python-m5p.git <feature_branch> --no-commit --ff-only

if the second step does not work, do a normal auto-merge (do not use rebase!):

bash git pull https://github.com/<git_name>/python-m5p.git <feature_branch> --no-commit

Finally review the changes, possibly perform some modifications, and commit.

Owner

  • Name: Sylvain Marié
  • Login: smarie
  • Kind: user
  • Company: Schneider Electric

solve. reuse.

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: m5py
message: 'If you use this software, please cite it as below.'
type: software
authors:
  - family-names: Marié
    given-names: Sylvain
    orcid: 'https://orcid.org/0000-0002-5929-1047'
identifiers:
  - type: doi
    value: 10.5281/zenodo.10552219
    description: Software (Zenodo)
repository-code: 'https://github.com/smarie/python-m5p'
url: 'https://smarie.github.io/python-m5p/'
repository-artifact: 'https://pypi.org/project/m5py/'
abstract: >-
  An implementation of M5 (Prime) and model trees for
  scikit-learn.
keywords:
  - python
  - model
  - tree
  - regression
  - M5
  - prime
  - scikit-learn
  - machine learning
license: BSD-3-Clause
doi: 10.5281/zenodo.10552219
preferred-citation:
  type: conference
  url: 'https://hal.science/hal-03762155/'
  authors:
    - family-names: Marié
      given-names: Sylvain
      orcid: 'https://orcid.org/0000-0002-5929-1047'
  title: >-
    `python-m5p` - M5 Prime regression trees in python, compliant with
    scikit-learn
  conference:
    name: "PyCon.DE & PyData"
    city: "Berlin"
    country: "Germany"
    date-end: "2022-04-13"
    date-start: "2022-04-11"

GitHub Events

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

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 34
  • Total Committers: 4
  • Avg Commits per committer: 8.5
  • Development Distribution Score (DDS): 0.206
Past Year
  • Commits: 11
  • Committers: 3
  • Avg Commits per committer: 3.667
  • Development Distribution Score (DDS): 0.455
Top Committers
Name Email Commits
Sylvain MARIE s****e@s****m 27
Luis Catala l****a@n****m 3
Sylvain Marié s****e@s****m 3
preinaj 7****j 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 18
  • Total pull requests: 3
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 7
  • Total pull request authors: 2
  • Average comments per issue: 0.78
  • Average comments per pull request: 2.0
  • Merged pull requests: 2
  • 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
  • smarie (11)
  • TheDumbfounds (1)
  • tkaraouzene (1)
  • camsilva (1)
  • Albi32 (1)
  • lccatala (1)
Pull Request Authors
  • lccatala (2)
  • preinaj (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 250 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
pypi.org: m5py

An implementation of M5 (Prime) and model trees for scikit-learn.

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 250 Last month
Rankings
Dependent packages count: 10.1%
Downloads: 12.9%
Stargazers count: 15.2%
Average: 15.8%
Forks count: 19.1%
Dependent repos count: 21.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

ci_tools/flake8-requirements.txt pypi
  • bandit <1.7.3
  • flake8 >=3.6,<4
  • flake8-bandit >=2.1.1,<3
  • flake8-bugbear >=20.1.0,<21.0.0
  • flake8-copyright ==0.2.2
  • flake8-docstrings >=1.5,<2
  • flake8-html >=0.4,<1
  • flake8-print >=3.1.1,<4
  • flake8-tidy-imports >=4.2.1,<5
  • genbadge *
  • jinja2 >=3.0.0,<3.1.0
  • mccabe >=0.6.1,<1
  • naming >=0.5.1,<1
  • pycodestyle >=2.6.0,<3
  • pydocstyle >=5.1.1,<6
  • pyflakes >=2.2,<3
  • setuptools_scm >=3,<4
noxfile-requirements.txt pypi
  • keyring *
  • makefun *
  • nox *
  • setuptools_scm *
  • toml *
.github/workflows/base.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact master composite
  • actions/setup-python v1 composite
  • actions/upload-artifact master composite
  • codecov/codecov-action v1 composite
  • conda-incubator/setup-miniconda v2 composite
  • kolpav/purge-artifacts-action v1 composite
  • pypa/gh-action-pypi-publish release/v1 composite
pyproject.toml pypi
setup.py pypi