1 var tools = require(
"./fos.js" )
3 var fos = new tools.FOS();
5 var vectorized_X = new tools.VectorDouble();
10 for ( i = 0; i < n * p ; i++ ) {
11 vectorized_X.push_back( Math.random() );
14 var Y =
new tools.VectorDouble();
16 for ( i = 0; i < n * 1 ; i++ ) {
17 Y.push_back( Math.random() );
20 var start = +(
new Date);
21 fos.Run( vectorized_X, Y,
"cd" )
22 var end = +(
new Date);
23 var difference = end - start;
25 console.log(
"Approximate execution time (ms): ", difference );
27 var coefs = fos.ReturnCoefficients();
28 var intercept = fos.ReturnIntercept();
30 console.log(
"Intercept: ", intercept );
32 console.log(
"Beta Vector:" );
34 for ( i = 0; i < coefs.size() ; i++ ) {
35 console.log( coefs.get(i) );