function WeightVector( dim, intercept ) {
	var i;
	if ( !(this instanceof WeightVector) ) {
		return new WeightVector( dim, intercept );
	}
	if ( !isPositiveInteger( dim ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a positive integer. Value: `%s`.', dim ) );
	}
	if ( !isBoolean( intercept ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a boolean. Value: `%s`.', intercept ) );
	}

	this.scale = 1.0;
	this.norm = 0.0;
	this.intercept = intercept;
	this.nWeights = dim + ( ( this.intercept ) ? 1 : 0 );

	this._data = new Array( this.nWeights );

	// Initialize weights to zero:
	for ( i = 0; i < this.nWeights; i++ ) {
		this._data[ i ] = 0.0;
	}
}
Creates a WeightVector.

@constructor
@param {PositiveInteger} dim - number of feature weights (excluding bias/intercept term)
@param {boolean} intercept - boolean indicating whether a bias/intercept weight should be implicitly assumed
@throws {TypeError} first argument must be a positive integer
@throws {TypeError} second argument must be a boolean