Skip to content

Source code for an ML extension for DuckDB - MInf project @ The University of Edinburgh

License

Notifications You must be signed in to change notification settings

Angus-Toms/QuackML

Repository files navigation

QuackML

QuackML is a DuckDB extension and aims to implement various ML tasks including regularised linear regression, Naive Bayes classifiers, and mutual information following principles of in-database machine learning. Under this approach, ML tasks are decomposed into batches of aggregate queries that are then evualuated within the database system. This extension is a work in progress.

Disclaimer: This extension is in no way affiliated with the DuckDB Foundation or DuckDB Labs. Therefore, any binaries produced and distributed of this extension are unsigned.

Design

This repository is based on https://github.com/duckdb/extension-template, check it out if you want to build and ship your own DuckDB extension.

Usage

To make this project first run

make

from the project directory and then build with the unsigned flag

./build/release/duckdb -unsigned

This launches the DuckDB CLI tool, then load the extension by running:

LOAD 'extension/quackml/quackml.duckdb_extension';

and you are then free to use QuackML's new functions:

CREATE TABLE test (features INTEGER[], label INTEGER);
INSERT INTO test VALUES ([1, 2], 4), ([-1, 0], -2), ([3, 5], 11);
SELECT linear_regression(features, label, 0.1, 0, 1000) as linear_regression FROM test;

┌───────────────────────────────┐
│       linear_regression       │
│           double[]            │
├───────────────────────────────┤
│ [2.0000000000, 1.0000000000]  │
└───────────────────────────────┘

About

Source code for an ML extension for DuckDB - MInf project @ The University of Edinburgh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published