npm.io
2.2.3 • Published 11 months ago

ml-basic

Licence
GPL-3.0
Version
2.2.3
Deps
1
Size
112 kB
Vulns
0
Weekly
0
Stars
2

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/dist/index.js" type="text/javascript"></script>

Usage

import { Neural } from 'ml-basic';

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..