From 67ebca31daa3c1365a54f8056c843aa7f2a2cabe Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:07:49 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- js/ml/nmf.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 js/ml/nmf.js diff --git a/js/ml/nmf.js b/js/ml/nmf.js new file mode 100644 index 0000000..e1a6113 --- /dev/null +++ b/js/ml/nmf.js @@ -0,0 +1,42 @@ +/** + * Created by joonkukang on 2014. 1. 16.. + */ +var utils = require('./utils'); +var math = utils.math; +let nmf = module.exports; + +nmf.factorize = function(options) { + var fc = options['features']; + var matrix = options['matrix']; + var epochs = options['epochs']; + var row = math.shape(matrix)[0], col = math.shape(matrix)[1]; + var a = math.randMat(row,fc,0,1); + var b = math.randMat(fc,col,0,1); + + var i; + for(i=0 ; i