Skip to content

Instantly share code, notes, and snippets.

View scottb's full-sized avatar

Scott Brickner scottb

  • The Brickner Group
  • Washington, DC
View GitHub Profile
@scottb
scottb / line.rb
Created August 31, 2012 03:16 — forked from actsasgeek/line.rb
ruby implementation of gradient descent linear regression
require 'generator'
samples = [
{ :xs => [ 1.0, 0.25], :y => 0.98},
{ :xs => [ 1.0, 0.49], :y => 0.82},
{ :xs => [ 1.0, 0.60], :y => 0.41},
{ :xs => [ 1.0, 0.89], :y => 0.31}
]
# line is the sum of the dot product of the weight (thetas)