From 96287fd04162344bcc2e82156dbc929cc267fdd7 Mon Sep 17 00:00:00 2001 From: Ronan LOUARN Date: Wed, 2 Jan 2019 10:10:46 +0100 Subject: [PATCH] Fix Matrix Error column_count method not working. I replaced it by column_size and it's ok. --- lib/ruby_linear_regression.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruby_linear_regression.rb b/lib/ruby_linear_regression.rb index 6842189..2022e08 100644 --- a/lib/ruby_linear_regression.rb +++ b/lib/ruby_linear_regression.rb @@ -28,7 +28,7 @@ def load_training_data x_data, y_data, normalize = true @x = Matrix.rows( x_data ) @y = Matrix.rows( y_data.collect { |e| [e] } ) - @theta = Matrix.zero(@x.column_count, 1) + @theta = Matrix.zero(@x.column_size, 1) end # Compute the mean squared cost / error function