Skip to content
DuckDB community extension

ml

Lightweight, columnar-native ML for DuckDB — train + inference, 34 algorithms, zero Python deps

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL ml FROM community;
LOAD ml FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Train linear regression

SQL
-- Train linear regression
SELECT * FROM ml_train('my_model', 'linear_regression',
  '[[1.0],[2.0],[3.0]]', '[[10.0],[20.0],[30.0]]', '{}');

-- Predict
SELECT ml_predict('my_model', 2.5);

Provided by alitrack. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

Pure Rust ML extension. 34 algorithms, zero Python dependencies.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
alitrack/duckdb-ml
License
MIT
Maintainers
alitrack
Written in
Rust
Build source
fd705cb580e1
Build definition
Community descriptor