I'd like to detect anomalies using the algorithm API listed in the algorithm API of the Nupic 1.0.1 documentation

Although I succeeded in detecting anomalies at run.py in the tutorial, I do not know how to detect anomalies in programs listed in the 1.0.1 Quick Start algorithm API.
The imported nupic module is completely different from run.py and algorithm API program, so it can not be copied and pasted, and it seems that algorithm API does not refer to inferenceType of model_params.
The program of the algorithm API is modified not to read from the yaml file but to read the parameters from model_params, so the prediction works.
How do I become able to detect anomalies with 1.0.1 Quick Start program?

Here is the complete running script from the docs you can start with:

Yes. I have not seen inferenceType though I tried it.
How can we detect anomalies with this program?

Crossposting to my reply in this relevant thread.