#ml #command-line-tool #practice #search #cli

app mlcheck

A tool to check files for ML best practices

7 releases

0.1.6 Jun 24, 2024
0.1.5 Jun 24, 2024
0.1.4 Apr 24, 2024

#1426 in Command line utilities

Download history 17/week @ 2024-09-10 7/week @ 2024-09-17 5/week @ 2024-09-24 1/week @ 2024-10-01

539 downloads per month

MIT/Apache

17KB
262 lines

mlcheck

mlcheck is a command line tool to check for ML best practices in different coding documents.

Think of this tool as a spell-check equivalent for ML best practices.

The current version can detect scikit-learn style Python code in .py or .ipynb (Jupyter Notebook) files and tidymodels style R code in .R or .Rmd files.

Install

If you have Rust and Cargo installed (see this resource if you haven't), you can install mlcheck from crates.io using:

cargo install mlcheck

Running mlcheck

To run mlcheck on a file you can run the following terminal command:

mlcheck --path path/to/your_file_name.py

To run mlcheck on a folder with .py and/or .ipynb files you can run the following terminal command:

mlcheck --path path/to/folder/

Analyzing mlcheck results

To look back at all the past checks you've run using mlcheck you can query the mlcheck_output.db sqlite database that's automatically created when you run mlcheck for the first time. As long as you run mlcheck in the same folder, new checks will be appended to the database.

sqlite3 mlcheckoutput.db

sqlite> select * from mlcheck_results

If you'd prefer to save your mlcheck results to a csv, run your commands like this

mlcheck --path path/to/your_file_name.py --output csv

Disclaimer

Note: mlcheck is at an incredibly early stage and is under active development. Breaking changes are likely.

Acknowledgements

The concept for this tool was in part inspired by the statcheck project.

Potential future features

  • Add more specific, sophisticated regex across styles

Dependencies

~25–35MB
~528K SLoC