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