aritter on Nostr: Another update on ranking: I optimized the logistic regression a bit (it's about 8ms ...
Another update on ranking:
I optimized the logistic regression a bit (it's about 8ms / iteration on 1000 events x 10 features). It could be made much faster, but I think it's fast enough, as Newton-Raphson method converges well.
I also added the API for groups, so now the model learns if a user likes some event that somebody usually likes, and the user likes some event that a somebody publishes (experimenting with adding a ,,self like'' automatically would be interesting as well).
Next steps are feature / model evaluation without using time, and then adding the time component (which is always a bit hacky, there's no real elegant solution).
Also I separated ranking to a function so that it's easy to include into clients later:
https://github.com/adamritter/light-nostr-client/blob/master/src/lib/ranking.tsThe current function call is this:
function processEventForLogisticRegression(
event: Event,
logisticRegressor: LogisticRegressor,
loggedInUser: string,
parentEvent?: Event
)
(the model can be trained and predictions for events retrieved later)
Published at
2023-04-18 23:10:16Event JSON
{
"id": "6dc44338498aa8bb66648ba7b792b681a395b5f0cd4ec963133c7fd6f0671ab1",
"pubkey": "6e3f51664e19e082df5217fd4492bb96907405a0b27028671dd7f297b688608c",
"created_at": 1681859416,
"kind": 1,
"tags": [],
"content": "Another update on ranking:\n\nI optimized the logistic regression a bit (it's about 8ms / iteration on 1000 events x 10 features). It could be made much faster, but I think it's fast enough, as Newton-Raphson method converges well.\n\nI also added the API for groups, so now the model learns if a user likes some event that somebody usually likes, and the user likes some event that a somebody publishes (experimenting with adding a ,,self like'' automatically would be interesting as well).\n\nNext steps are feature / model evaluation without using time, and then adding the time component (which is always a bit hacky, there's no real elegant solution).\n\nAlso I separated ranking to a function so that it's easy to include into clients later:\n\nhttps://github.com/adamritter/light-nostr-client/blob/master/src/lib/ranking.ts\n\nThe current function call is this:\n\nfunction processEventForLogisticRegression(\n\tevent: Event,\n\tlogisticRegressor: LogisticRegressor,\n\tloggedInUser: string,\n\tparentEvent?: Event\n)\n\n(the model can be trained and predictions for events retrieved later)",
"sig": "6c3e5f2c7f24c6047a654b2f7215f213ddfc370de5d76a14f8810d364864ec407e08a5bd70c3a7b076170680549b4e8421b256bb7ab5f31e14d73b38490a6b1b"
}