Linter for Machine Learning projects
Project description
mllint
— Linter for Machine Learning projects
mllint
is a command-line utility to evaluate the technical quality of Machine Learning (ML) and Artificial Intelligence (AI) projects written in Python by analysing the project's source code, data and configuration of supporting tools. mllint
aims to ...
- ... help data scientists and ML engineers in creating and maintaining production-grade ML and AI projects, both on their own personal computers as well as on CI.
- ... help ML practitioners inexperienced with Software Engineering (SE) techniques explore and make effective use of battle-hardended SE for ML tools in the Python ecosystem.
- ... help ML project managers assess the quality of their ML and AI projects and receive recommendations on what aspects of their projects they should focus on improving.
mllint
does this by measuring the project's adherence to ML best practices, as collected and deduced from SE4ML and Google's Rules for ML. Note that these best practices are rather high-level, while mllint
aims to give practical, down-to-earth advice to its users. mllint
may therefore be somewhat opinionated, as it tries to advocate specific tools to best fit these best practices. However, mllint
aims to only recommend open-source tooling and publically verifiable practices. Feedback is of course always welcome!
mllint
is created during my MSc thesis in Computer Science at the Software Engineering Research Group (SERG) at TU Delft and ING's AI for FinTech Research Lab on the topic of Code Quality and Software Engineering for Machine Learning projects
See docs/example-report.md to view the report generated for this example project.
Installation
mllint
is compiled for Linux, MacOS and Windows, both 64 and 32 bit x86 (MacOS 64-bit only), as well as 64-bit ARM on Linux and MacOS (Apple M1).
mllint
is published to PyPI, so it can be installed globally or in your current environment using pip
:
pip install mllint
Alternatively, to add mllint
to an existing project, if your project uses Poetry for its dependencies:
poetry add --dev mllint
Or if your project uses Pipenv:
pipenv install --dev mllint
Usage
mllint
is designed to be used both on your personal computer as well as on CI systems. So, open a terminal in your project folder and run one of the following commands, or add it to your project's CI script.
To run mllint
on the project in the current folder, simply run:
mllint
To run mllint
on a project in another folder, simply run:
mllint path/to/my-ml-project
mllint
will analyse your project and create a Markdown-formatted report of its analysis. By default, this will be pretty printed to your terminal.
If you instead prefer to export the raw Markdown text to a file, which may be particularly useful when running on CI, the --output
or -o
flag and provide a filename. mllint
does not overwrite the destination file if it already exists, unless --force
or -f
is used. For example:
mllint --output report.md
Using -
(a dash) as the filename prints the raw Markdown directly to your terminal:
mllint -o -
In CI scripts, such raw markdown output (whether as a file or printed to the standard output) can be used to e.g. make comments on pull/merge requests or create Wiki pages on your repository.
See docs/example-report.md for an example of a report that mllint
generates.
Of course, feel free to explore mllint help
for more information about its commands and to discover additional flags that can be used.
Linters, Categories and Rules
mllint
analyses your project by evaluating several categories of linting rules. Each category, as well as each rule, has a 'slug', i.e., a lowercased piece of text with dashes or slashes for spaces, e.g., code-quality/pylint/no-issues
. This slug identifies a rule and is often (if not always) displayed next to the category or rule that it references.
To list all available (implemented) categories and linting rules, run:
mllint list all
To list all enabled linting rules, run (optionally providing the path to the project's folder):
mllint list enabled
By default, all of mllint
's rules are enabled. See Configuration to learn how to selectively disable certain rules.
To learn more about a certain rule or category, use mllint describe
along with the slug of the category or rule:
# Describe the Version Control category. This will also list the rules that it checks.
mllint describe version-control
# Describe the rule on DVC usage in the Version Control category
mllint describe version-control/data/dvc
Configuration
mllint
can be configured either using a .mllint.yml
file or through the project's pyproject.toml
. This allows you to selectively disable specific linting rules or categories by means of their slug, as well as configure specific settings for various linting rules. See below for examples of such configuration files.
To print mllint
's current configuration in YAML format, run (optionally providing the path to the project's folder):
mllint config
To print mllint
's default configuration in YAML format, run (unless there is a folder called default
in the current directory):
mllint config default
To create a .mllint.yml
file from mllint
's default configuration, run:
mllint config default -q > .mllint.yml
YAML
An example .mllint.yml
that disables some rules looks as follows:
rules:
disabled:
- version-control/code/git
- dependency-management/single
TOML
If no .mllint.yml
is found, mllint
searches the project's pyproject.toml
for a [tool.mllint]
section. TOML has a slightly different syntax, but the structure is otherwise the same as the config in the YAML file.
An example pyproject.toml
configuration of mllint
is as follows. Note that it is identical to the YAML example above.
[tool.mllint]
[tool.mllint.rules]
disabled = ["version-control/code/git", "dependency-management/single"]
Getting Started (development)
While mllint
is a tool for the Python ML ecosystem and distributed through PyPI, it is actually written in Go, compiled to a static binary and published as platform-specific Python wheels.
To run mllint
from source, install the latest version of Go for your operating system, then clone this repository and run go run .
in the root of this repository. Use go test ./...
or execute test.sh
to run all of mllint
's tests.
To test compiling and packaging mllint
into a Python wheel for your current platform, run test.package.sh
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for mllint-0.8.1-pp37-pypy37_pp73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b672cd3a169efb74f8a361d7d4d07f21435062e69532b6ac65b344b6a7595251 |
|
MD5 | 3ed13cf06b2c4b88e2705d3ca0ab10d7 |
|
BLAKE2b-256 | bb6d8f7d3bfc082b06470744a81a0f5267b987b67e99a5244ef69f611587c6be |
Hashes for mllint-0.8.1-pp37-pypy37_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 675759e27a50b01678f540fa91c22b22bab2da854299efcc4bdb1eb7f420f2d7 |
|
MD5 | 5270bc6eb9b1fcd7ca9b3f9b19440fcc |
|
BLAKE2b-256 | 5a7d1f445d4c5186497dd5ecc3bbe3a2fa5ceda885417b5942b9b70fe71de47b |
Hashes for mllint-0.8.1-pp37-pypy37_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06147a18d42e884d2f30aa407b926a286325c1aad7d77b651386876f54a52fa5 |
|
MD5 | 244300b2ed996243877229fe85788ea7 |
|
BLAKE2b-256 | f89c0a9bebe03c3dd5d1e0dbed3f676481161bb347b179ffdbb0e27de19a5033 |
Hashes for mllint-0.8.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 352a638529b40eb981dc6ccaeb8a5136bca2f340a6c7179fdc2c7290b4438e2c |
|
MD5 | bb03a3f00fde8067363322faf8abd69d |
|
BLAKE2b-256 | aaad8f2576d8a7a278b092547bbf55651e53330c8b8e7b2812f91ff04695944f |
Hashes for mllint-0.8.1-pp36-pypy36_pp73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c578cfb35a8384764ffd68bad392e782c00d29c8a19b38a584f808db64bad38b |
|
MD5 | b2756dffefa0950ce49ee25baf22a342 |
|
BLAKE2b-256 | 79a298ca85c4431c78888ec55b001c0c0e754298eaf3cc3b2e4b95f36c2496f5 |
Hashes for mllint-0.8.1-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2322dcf5a72c3e3593b8f9e3db4c191557857c7dbcfc0694095584ee35cc7913 |
|
MD5 | 21fab9d218aed53d35f9b416f1713f3c |
|
BLAKE2b-256 | 6adf4ea043f18bc9bba796ca769d9e075e09be7bc74cd7a11fe104a7ed933838 |
Hashes for mllint-0.8.1-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd63024ac412d8a61e29b28fee0c378be86ea036519a66ccf0cc5fe6d761a073 |
|
MD5 | 04a62d4fb4f6bc4fa4c38a5c9a937a25 |
|
BLAKE2b-256 | 6c886ce8dff76e5ca5afd86e8d3a5476adb9938522c9cfb5821e77935a061c22 |
Hashes for mllint-0.8.1-pp36-pypy36_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16f2fb78ea1e82ee13898a8774e50dad917f6f5027089035dc7455f891b9c43b |
|
MD5 | 526b2f4b34b320485e9ac5e3db5c1ff9 |
|
BLAKE2b-256 | 2b0af685b6c52dae5ad832d8531a808e5828c9ddd78c5cc1c46a18e1700fe83a |
Hashes for mllint-0.8.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78509cc6e4fe045cdec33a9444ceb80e434397b5c5c4a1cd408bd7e24870c572 |
|
MD5 | 68fa7f28ed5bb689a78aceb20f48a814 |
|
BLAKE2b-256 | fbe45b0694e5011f5fcfd2517f99e0ce3ff27a96caad0d66b695c4982db2bb09 |
Hashes for mllint-0.8.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f06031f41c92ba29b4471e0b12eadbdcd142ae11e94bcba0c880a2a3cc855d4 |
|
MD5 | 436eadfe89a0e2c0820006bddcde9b99 |
|
BLAKE2b-256 | 04220f5cf2e28e3a319e32b766e1fadc4aa5f791462006c604f25ff54139cae8 |
Hashes for mllint-0.8.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1568260882fa7daf44b60fb7b8b44c10d8306306f7fe85ecbafeee0e64dd14d8 |
|
MD5 | ecaf1e8dd0657d390e085f5575bab7ca |
|
BLAKE2b-256 | d05e3ea5171b97ef6e0052113ec7141423bd810c6db95dfd0b0bd917618a4b3b |
Hashes for mllint-0.8.1-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 289658098f3c9549d4ca2d04d3d1ccf64534653d98663eb6bbbd0a5ab84e2d22 |
|
MD5 | 167b2b3b575a1a6c8ca7ad4e861656b3 |
|
BLAKE2b-256 | 758dfe5555beb9cf55aa9b8cb3a5464e7034d03b80c7f163d56fb01b4a839e9d |
Hashes for mllint-0.8.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d453eb38c61e208d7a4ec650d82c34356038aaef533c62f1dc8645a1a84dbedc |
|
MD5 | 9bc03d2787f783d319cf0937b9e93631 |
|
BLAKE2b-256 | 51382ca3d3b32f5e72d5fab7d7da924093342ac3ab1b7b87fbb22b59869c53f3 |
Hashes for mllint-0.8.1-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd717a66dc89b3182f1f2577a9d4f8a93beb2b8deff1332e84489fab29ec28fa |
|
MD5 | 9a51322ff199b54d03bb609a36c690a3 |
|
BLAKE2b-256 | 045128df5586ec298b0e2499f95f97a8422d6cb7cd058e9373c15591ea35b630 |
Hashes for mllint-0.8.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5154e88f2217a5e25acc55d75a8e739a1b413bb7f71b7327eca45437a80078a |
|
MD5 | 094a19f06fd7b2211a8c3ab92155ed3a |
|
BLAKE2b-256 | 7ac602bb3d4f18f72a57bca53acbe1112a64e75cabcea61604fb78fd3f2a29aa |
Hashes for mllint-0.8.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 392b14512a193386b336990b60e4bd22d0cb03b221a1100bfdc4fe7f6bb7704b |
|
MD5 | ce8133f739a49245c486b03c05d1c828 |
|
BLAKE2b-256 | 7905371f1180044fe3a023c533e99257a002017953cba8cda3472255677c27ef |
Hashes for mllint-0.8.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2db180286cc896cbac43ff401c0adab1f7d169d5ca04ec8331b2a329cf066d4a |
|
MD5 | 59cdfc0b9648a19235e4a0a914bf8516 |
|
BLAKE2b-256 | 8b4f3b0d9900122e217dd4f2edb6320c1cf70da4f78ad26a62348b6427db9b30 |
Hashes for mllint-0.8.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87ad9f637c834387661ddfe26b82ac6064f3efd0f0f664e3777c539906dac8e |
|
MD5 | a32203727c760b62d5d575863efb2b7d |
|
BLAKE2b-256 | 1f70e27538c7cd1d17ee7e871bc9a1d37d29c702942f6a3ea1aaf6e2bd60da68 |
Hashes for mllint-0.8.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 121b6be8e0e691cc9c73d6ca576887bf32cb7c59017df6565c5860cf221c0520 |
|
MD5 | 1104f9ec593bf6c2f70d86a21dde0312 |
|
BLAKE2b-256 | 20f563fea5fa6fa8925c539f45a507d41e03da639bbe138f426f3337f3548fe0 |
Hashes for mllint-0.8.1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf3b32654c528f67e75b43931bf743afa3d926a6aa2c0d7c30e02c1d5e10d057 |
|
MD5 | 772b343e20d7683a96786576fe52841e |
|
BLAKE2b-256 | acdb93d6366ad78b4c548a4263ab60930d70464dca9773e9bb2f2a266ffe9f35 |
Hashes for mllint-0.8.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a24af99f290274d35f2b4bfccb03db5e6f4dbc5bbbd122d2810ab7fd9476e481 |
|
MD5 | 56d262845cfc80ab9120b1d74ac5cf88 |
|
BLAKE2b-256 | 160ea9a53ee44cb4c911cef369b03e51c7e12ae57f71d1f469f40a5b04aed491 |
Hashes for mllint-0.8.1-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edaf67a6adfd79ab31c614e61bc0a7774e4753ebd52263729e24d2866951dee3 |
|
MD5 | 3836d6a73665152268854349d9867b16 |
|
BLAKE2b-256 | 22f7527a0ebfc88b8eedfca6193e0f577936cd215976126e94d93e464957fcb2 |
Hashes for mllint-0.8.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42013c1ff89c8295a31668c2b73f7c2d07932f58373bd812f5ea5bfeae8acb5e |
|
MD5 | 99f5007d71a3f2d34fb734b893cc12f9 |
|
BLAKE2b-256 | 5b85c5a1e633a65df23ebab51208ebe345ae989096981fdba7165286f88254a7 |
Hashes for mllint-0.8.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ad03f22eac11c80991f14f2822fba8732cdcad2d3d5d37849874d6117af0d1f |
|
MD5 | cf13afec2aff3c86c600d352ff525e75 |
|
BLAKE2b-256 | 0029ed70064dbbecb1553a208aa612820b08512be2db51c8ca015acfa6267c76 |
Hashes for mllint-0.8.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0c42ccec1f1782a4633dbfc3f5286235edf66d2a40d28507b84d9b4dc558a5b |
|
MD5 | 4c8d7b7587f3c1e7472ceb24c4cb693b |
|
BLAKE2b-256 | 12c050477a614e271a6a325b053be6429c118aca7616680f05eb525fe2bebc12 |
Hashes for mllint-0.8.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51bb68dc1c67e36b68fd38c2348cf269eeac879a1d026f85892b05cc31a38473 |
|
MD5 | 9d5fccc319e3f421aa557d7416d6fff9 |
|
BLAKE2b-256 | cbcaeac5b9c947ba8ccd409f35c10188d14e19759f1f88a069dd2941242c6630 |
Hashes for mllint-0.8.1-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acedbebae5cda241595b75d635ad19b2c3b96b2578ea4ae28316d08637506a30 |
|
MD5 | cc215fb9eebbf0a4f68a2f61626f6b17 |
|
BLAKE2b-256 | c98434d97fc12d9dd5e1309c51e55fa13e2441282a883af3a7801ab3fcd81a51 |
Hashes for mllint-0.8.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc087e3e4b0b9548a431487e85e952af08c1d01413133b3639aeedb5b2159e77 |
|
MD5 | b9deed6b15c5b3d50e5d82bf4096f26f |
|
BLAKE2b-256 | 4de3a994fd8b3a8ea8fdf31ec3a10a0324491b75c8c778de0275b7c5f042a244 |
Hashes for mllint-0.8.1-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6b145cb11c64d7bf1a1a82c2147321c5899064496b884c09f61f01a3296826 |
|
MD5 | 2e9881aa6e746e607d956c9bc28c9878 |
|
BLAKE2b-256 | dfcb10c746478bc258ddcf1cea2efe616aa7a49c389deaa280d555e39df361fe |
Hashes for mllint-0.8.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f66feeea42a02d08baccebaa59377e518a2c3c2288b901bbce238cdb53f4ccfe |
|
MD5 | ee2f50c413731e53c515c4a9dc690bbd |
|
BLAKE2b-256 | d110062781f48582f7a3a7989fb3da7ad160d02a6c3b3e85c61517b020ae357a |
Hashes for mllint-0.8.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ae19a2f54670fe22c577b9640846de686a2227bcb6ec1d3462a60997e331b8 |
|
MD5 | 719269b7e4f41b0f62089a2e63954ba5 |
|
BLAKE2b-256 | a87935b2f14a8f54ac51352a0391f823631f0bcfe2dd1d810d0ef7cff876be65 |
Hashes for mllint-0.8.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf8881da01bb6ca0d6cd2bfcbc4123764f95817af7e41960c362d8ff800030a1 |
|
MD5 | 1c9b6dfe55bdb2a5a4fd02fe448c7b18 |
|
BLAKE2b-256 | f630073192e26a47b68809f01d308f2e72c63bf739430ec77a31bc604d9ce33d |
Hashes for mllint-0.8.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c4d6828e2a1999074d5661dc209cd26a976cf78a8831608afeab2776e98c282 |
|
MD5 | 0b627616431db632ffe124402ad75eed |
|
BLAKE2b-256 | 53ff70eb126c8928c7b262463a48f176aa32940bd435a8a86c97d07cca3f78c9 |
Hashes for mllint-0.8.1-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46e69e9161de121dc6f46c42867a717efabace4f59a563492ed71615a67c609c |
|
MD5 | 7ab77f60cc6a2197e6ae2b043038aa29 |
|
BLAKE2b-256 | ecde2c6899dae9ac1f5d91188e952b6333c2fcff1d2720b65b55f3904d6b629f |
Hashes for mllint-0.8.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46124e8ecba6ff7b62477b3c570ceb186a7ad91a1d72cd8ebdae0364a7694cd9 |
|
MD5 | b0c66dde81d55ef42693d03dc1b2b8aa |
|
BLAKE2b-256 | c8f4680f4a7a8d129823340e5ded5bb124382e88f787d8e1cb13989c45a5495d |
Hashes for mllint-0.8.1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98993dbe880b754b5372d7dda1dac165510d6a204168b973d885f9cb88dd3586 |
|
MD5 | 23d8ebd983b4fd14c7581d73a52bd2d2 |
|
BLAKE2b-256 | 5ec055646a8c770e76692ad0bd291404cecaede256da20d9d95b672ff248afea |
Hashes for mllint-0.8.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d602cddabcccfaddfd9922bdf190120010e7f882c8e52bbd591210dbbbc0ac73 |
|
MD5 | 3c602b4dab07f1ba625c324c3bc145a8 |
|
BLAKE2b-256 | 5e2a3fe6c0b8b62c3eab354f0d6a4344957e3c17cec4c2f8e04556de1fe7da3e |