2.0.0 • Published 7 years ago

matrix-factorization v2.0.0

Weekly downloads
28
License
MIT
Repository
github
Last release
7 years ago

Matrix Factorization JS

A matrix factorization implementation in Javascript. This is a Work in Progress. Use at your own risk.

Build Status codebeat badge Maintainability Coverage Status npm.io

forthebadge forthebadge forthebadge

To try an interactive example, clone and edit this Runkit Notebook.

Installing / Getting started

Install using npm:

npm install matrix-factorization

Import in code

// Node, ES5
var matrixFactorization = require('matrix-factorization')

// Node, ES6
const matrixFactorization = require('matrix-factorization')

Install using yarn:

yarn add matrix-factorization

Import in code

// Node, ES5
var matrixFactorization = require('matrix-factorization')

// Node, ES6
const matrixFactorization = require('matrix-factorization')

Install with minified library

Copy matrix-factorization.min.js from dist/matrix-factorization.min.js to a lib folder.

Import in code

<script src="lib/matrix-factorization.min.js"></script>

This will expose a matrixFactorization variable which you can access the functions from.

Include using CDN

<script src="https://cdn.jsdelivr.net/npm/matrix-factorization@1.1.2/index.min.js"></script>

This will expose a matrixFactorization variable which you can access the functions from.

Using a function in the library:

Just reference a function using the dot notation. For example, to use the sum function, you can do:

matrixFactorization.factorizeMatrix(targetMatrix, numberOfLatentFactors)

Example

var factors = factorizeMatrix(targetMatrix, numberOfLatentFactors)
var completeMatrix = matrixFactorization.dot(factors[0], matrixFactorization.transpose(factors[1]))

Roadmap

  1. Create demo app.
  2. Improve docs.

Notes

Implementation based on this article by @albertauyeung.

License

MIT

2.0.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago