Example usage of Coordinate Encoder

What version of nupic are you running? That error is strange because it refers to modelfactory.py, which was changed to model_factory.py recently. So you may not have the most recent installation.