Optimize matrix performance with NArray, GSL, or NMatrix
masterBy default, the library uses the Ruby Standard Library's Matrix class. For better performance, you can use the :library option when initializing a model to use narray, gsl, or nmatrix. narray is noted to have the best performance of the three.
require 'narray'
model = TfIdfSimilarity::TfIdfModel.new(corpus, :library => :narray)