Giter Club home page Giter Club logo

lightgbm's Introduction

Standartized DS project template

Project Organization

├── LICENSE
├── Makefile           <- Makefile with commands like `make data` or `make train`
├── README.md          <- The top-level README for developers using this project.
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
│                         the creator's initials, and a short `-` delimited description, e.g.
│                         `1.0-jqp-initial-data-exploration`.
│
├── references         <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures        <- Generated graphics and figures to be used in reporting
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── setup.py           <- makes project pip installable (pip install -e .) so src can be imported
└── src                <- Source code for use in this project.
    ├── __init__.py    <- Makes src a Python module
    │
    ├── data           <- Scripts to download or generate data
    │   └── make_dataset.py
    │
    ├── features       <- Scripts to turn raw data into features for modeling
    │   └── build_features.py
    │
    ├── models         <- Scripts to train models and then use trained models to make
    │   │                 predictions
    │   ├── predict_model.py
    │   └── train_model.py
    │
    └── visualization  <- Scripts to create exploratory and results oriented visualizations
        └── visualize.py

====

Concept

Goals

  • Reduce time to establish a repo specifically for DS needs.
  • To align data scientists in terms of skills and tools used.
  • Make project standard, easier to observe and predictable.

Description:

Project structure

The current architecture is based on Cookicutter DS appoach. The reasoning behind it you can find here.

Code versioning tools

To track, keep and share your codings git and GitHub services are required.

Default programming language

To leverage modern programming stack it is recommended to start with Python 3.10 as default.

Dependency management

To follow Single-Source-Of-Truth concept it makes sense to use pyproject.toml to store project configuration. pyproject.toml configuration file allows to use the same configuration on different project steps: CI/CD, dev, test, prod etc.

To manage Python dependencies using the same file we can use poetry.

Codestyle: isort, black, pylint

The main idea is to make code style checking:

  • Sufficient. Different parts of the code style suite are responsible for different code characteristics and neither of them can substituite all of them.
  • Modular. In future it is possible to change some parts of the code style suite without affecting other parts, e.g. pylint -> ruff, isort -> reorder-python-imports etc.
  • Separate from dev, test, prod and other environments. The linting and formatting tool are used only on checking stage and are redundant for other Docker images.

To apply code style suite easily, use make precommit command. You can find a set of commands in Makefile.

The current code style suite includes following stages:

isort

Use isort to keep your imports in order. The library takes its configuration from pyproject.toml, section [tool.isort]

black

Use black formatter for stable code formatting rules. The library takes its configuration from pyproject.toml, section [tool.black]

pylint

Use pylint to analyse your Python code.

Note that pylint keeps its configurations in separate file .pylinrc. For more convinience the general template of this file was added to the project template.

CI/CD: GitHub Actions

As a baseline, CI with integrated code style is provided (see .github/workflows/ci.yml). The current setup is based on using public Actions and configurating CI with pyproject.toml file. It is also possible to use corporate Actions.

Test suite:

TO BE DONE (pytest)

Getting started

  1. Create repo from the template

While creating repo, choose the current one as a template. Check tutorial for more details.

  1. Install poetry

The recommended way to install poetry and aviod additional issues is to install it with pip. Check the link for exact commands. In CI it is possible to use poetry Action

  1. Change parameters pyproject.toml if needed.
  2. Put you source code in src folder.
  3. Tweak CI configuration .github/workflows/ci.yml if needed.
  4. Enjoy coding :)

Best practices

TO BE DONE

Makefile

Cli with typer

lightgbm's People

Contributors

fortis3000 avatar

Watchers

 avatar

lightgbm's Issues

Add CI

To add automatic linting to CI
To automate CI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.