PageRank with Log Scaler: "Negative values cannot be recorded"

I want to calculate a page rank on my graph.

    nodeProjection: "Nutzer",
    relationshipProjection: "ANTWORTETE_AUF",
    writeProperty: "pageRank",
    scaler: "log"

but I get the following error:

Failed to invoke procedure `gds.pageRank.write`: Caused by: java.lang.ArrayIndexOutOfBoundsException:
The value -1.5672566228294513 is out of bounds for histogram, current covered range
[6.668014432879854E240, 5.3344115463038834E241) cannot be extended any further.
Caused by: java.lang.ArrayIndexOutOfBoundsException: Negative values cannot be recorded

It seems like it's writing to an unsigned data type? Stream mode works perfectly fine.

Update: At least some values are written to the db.

I'm using Neo4j 4.3.3 and GDS 1.6.4

Hey Sandro,
the underlying issue is in the computation of the centralityDistribution when using the write or mutate mode.
We always assumed, that the pageRank scores are positive, but by using a log scaler, the scores can get negative.

We will look into fixing the bug, but in the meantime you can use Call gds.pageRank.write({ nodeProjection: "Nutzer", relationshipProjection: "ANTWORTETE_AUF", writeProperty: "pageRank", scaler: "log" } ) YIELD ranIterations, nodePropertiesWritten (Basically everything can be yielded except centralityDistribution)

1 Like

Also you can use a different scaler. For the traditional PageRank scores, the L1Norm scaler should work.