brainlog
Machine learning library for Node.js
Introduction
The current implementation supports three algorithms:
-
Logistic Matrix Factorization for Implicit Feedback Data
-
Alternating Least Squares
-
Bayesian Personalized Ranking
- edited from: https://github.com/quora/qmf
- paper: https://arxiv.org/pdf/1205.2618.pdf
Installation
# npm
npm install brainlog
# yarn
yarn add brainlog
Usage
Here's a basic example of usage:
# To train Logistic Matrix Factorization
const engine = require('brainlog').engine;
const ratingMatrix = [
[ 1, 0, 3, 4 ],
[ 0, 8, 0, 7 ],
[ 6, 0, 5, 0 ],
];
const factors = 3;
const iterations = 30;
const regularization = 0.1;
const gamma = 1.0;
const seed = 1;
const modelMatrix = engine.trainLogisticMF(ratingMatrix, regularization, gamma, factors, iterations, seed);