Skip to content

Instantly share code, notes, and snippets.

@oem
Created April 15, 2018 10:32
Show Gist options
  • Save oem/41ce55d409a87b33d1c774690f984637 to your computer and use it in GitHub Desktop.
Save oem/41ce55d409a87b33d1c774690f984637 to your computer and use it in GitHub Desktop.
matrix multiplication to predict all labels in one go
require 'matrix'
Matrix[[10, 1000, 10], [5, 800, 2], [12, 2500, 3]] * Vector[200,-0.1,-10] # => Vector[1800.0, 900.0, 2120.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment