Link Search Menu Expand Document

DataCook

Machine learning and data science library for Javascript / Typescript.

Get started now View it on GitHub


Construction

DataCook provides ready-to-use typescript/javascript api for statistical machine learning and data science. Following diagram shows the main components of DataCook.

Getting started

Dependencies

DataCook is built for javascript environment and can run in both node.js platform and browser. DataCook relies on tensorflow.js for basic numeric computation.

Quick installation

DataCook can be installed by npm:

npm install @pipcook/datacook

or by yarn

yarn add @pipcook/datacook

Quick start: Train a simple linear-regression model

import {LinearRegression} from '@pipcook/datacook';

const X = [
  [4, 5],
  [2, 3],
  [1, 4],
  [3, 8],
];
const y = [10, 5.5, 6.5, 12];
// create model
const lm = new LinearRegression();
// train linear model using feature set X and label set y
await lm.fit(X, y);
// get prediction
const yPred = lm.predict(X);
yPred.print();
// [10, 6, 6, 12]