Márcia,
It is not currently possible to change the similarity function. Hard-wiring the cosine similarity into the algorithm gives us substantial performance benefits, and the utility of other similarity functions is debatable.
If you do actually need the Pearson correlation, you either need to copy & modify the UserKNN source code, or use the old Java LensKit. I would entertain a pull request that adds generalized neighborhood algorithms, provided we retain the fast-path for the common case of cosine similarity.
- Michael