'use strict';

var OnlineSGDRegression = require( './../lib' );
var randu = require( '@stdlib/math/base/random/randu' );
var x1;
var x2;
var y;
var i;

// Create model:
var model = new OnlineSGDRegression({
	'lambda': 1e-4,
	'loss': 'squaredError',
	'intercept': true
});

// Update model as data comes in...
for ( i = 0; i < 100000; i++ ) {
	x1 = randu();
	x2 = randu();
	y = 3.0 * x1 + -3.0 * x2 + 2.0;
	model.update( [ x1, x2 ], y );
}

// Extract model coefficients:
console.log( model.coefs );

// Predict new observations:
console.log( 'y_hat = %d; x1 = %d; x2 = %d', model.predict( [0.9,0.1] ), 0.9, 0.1 );
console.log( 'y_hat = %d; x1 = %d; x2 = %d', model.predict( [0.1,0.9] ), 0.1, 0.9 );
console.log( 'y_hat = %d; x1 = %d; x2 = %d', model.predict( [0.9,0.9] ), 0.9, 0.9 );

@@ -16,105 +16,105 @@
 var 
-OnlineSGDRegression = require( './../lib' );%0Avar randu = require( '@stdlib/math/base/random/randu
+randu = require( '@stdlib/math/base/random/randu' );%0Avar OnlineSGDRegression = require( './../lib
 ' );

Reorder require statements