You have a nan in your svd input… The reason for nan is usually the output of the previous function has a nan. The anonmly detection doc has a pretty good example on how to apply it on a module. It should be helpful in finding where it happens.