Where to put large algorithm class

I have a large algorithm class (50-100 methods) that uses several temp
arrays that brings in data from several models. Should this be put as
a myalgorithm.rb under the models directory? or controller directory ?
Or should it be a module since it really doesn’t need different
instantiations ? And if module, where should it be placed ? thks.