I can't do a great job of answering this question, but I can address some parts!
First of all, everything I know about using sklearn I read at:
https://github.com/qupath/qupath/wiki/Working-with-PythonAnd second of all, you can definitely create and use any value you want with the heatmap function, you just need to use something like:
import qupath.lib.scripting.QP
for (def cell : QP.getDetectionObjects()) {
def ml = cell.getMeasurementList()
ml.putMeasurement("Measurement1", 0)
ml.putMeasurement("Measurement2", SomeNumericVariable)
ml.closeList()
}
QP.getCurrentHierarchy().fireHierarchyChangedEvent(this)
println("Done")
Which cycles through all of the cells and adds your measurement to the cell. Loading the correct measurement from outside of QuPath into the correct cell in QuPath might be slightly trickier, but if you just created a new measurement called "Count" and used putMeasurement to increment over all cells, you shouldn't have any trouble matching the cells back up with their probabilities. XY centroids could also be used.