Skip to content

Instantly share code, notes, and snippets.

@Thomascountz
Created October 4, 2018 17:05
Show Gist options
  • Save Thomascountz/4fcff9c813780893013ad3cf0cd6c7ff to your computer and use it in GitHub Desktop.
Save Thomascountz/4fcff9c813780893013ad3cf0cd6c7ff to your computer and use it in GitHub Desktop.
class LinearModel
def initialize(y_intercept, slope)
@y_intercept = y_intercept
@slope = slope
end
def predict(x)
return @slope * x + @y_intercept
end
end
string_length_predictor = LinearModel.new(-22, 165)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment