Skip to content

Lightweight, zero dependency, machine learning library.

License

Notifications You must be signed in to change notification settings

infinityfx-llc/ml-basic

Repository files navigation

ml-basic

NPM package NPM bundle size Last commit NPM weekly downloads NPM downloads

Lightweight, zero dependency, machine learning library for use in NodeJS and browsers.

Table of contents

Importing

CommonJS

const MLBasic = require('ml-basic');

ESM

import MLBasic from 'ml-basic';

Browser

<script src="https://unpkg.com/browse/ml-basic/index.js" type="text/javascript"></script>

Usage

const net = new Neural({
    layers: [
        ...
    ]
});

const result = net.predict([1, 0]);

// result = [0.532..]

Training

import { DataFrame } from 'ml-basic';

const data = new DataFrame([ ... ]);

const error = await net.fit(data);

// error = 0.532..