Why am I seeing lot of false positives?

Oh yes, there is one more cryptic step that needs to be done. The RDSE doesn’t actually take a numBuckets parameter, it takes a resolution. This is calculated on the fly based on the min/max of the input data and the numBuckets. You can see this here:

https://github.com/numenta/nupic.workshop/blob/master/part-1-scalar-input/run_anomaly.py#L36-L41

You will have to do something similar when creating the model. For details on RDSE parameters, see HTM School Episode 5: Scalar Encoding.