I want to compute beyond accuracy metrics so I need topn from predictions, however the problem is that for example in top10 items, nearly half of the predictions are NaN. To fix it I can use the code below
However since build_anti_testset() fills the unkown ratings with means, it corrupts the metrics.
Using below approach
for uid in range(0, 944):
for iid in range(0, 1683):
pred = algo.predict(str(uid), str(iid))
How can I save the predictions in the same format as predictions = algo.test(testset) ? So I can have a filled topn lists without NaN ' s and calculate the metrics I want.
Help is appreciated in terms of ideas as well. Thanks everyone.
Description
I want to compute beyond accuracy metrics so I need topn from predictions, however the problem is that for example in top10 items, nearly half of the predictions are NaN. To fix it I can use the code below
However since build_anti_testset() fills the unkown ratings with means, it corrupts the metrics.
Using below approach
How can I save the predictions in the same format as
predictions = algo.test(testset)
? So I can have a filled topn lists without NaN ' s and calculate the metrics I want.Help is appreciated in terms of ideas as well. Thanks everyone.