# How to grade an interaction that a user had with a post with an AI based on big data?

## Context

I'm creating a social network.

The thing is, I don't want to order posts by likes, or something like that, I'm using an AI (lightfm in python). This AI uses a hybrid recommendation system based on ratings that users have given to posts.

For this part, everything works, BUT for testing I was using fake ratings that I've manually entered the database.

THE REAL QUESTION IS, how do I get the rating that a user has given to a post without asking him and only knowing his interactions (liked, shared, commented, watch time, etc...)

Interaction example:

{
"average_watch_time": 2.4739250771067502,
"follow_on_init": true,
"id": 0,
"interactions": [
{
"at": 1608370856,
"id": 0,
"type": "first_time"
},
{
"at": 1608370860,
"id": 1,
"type": "see_profile"
},
{
"at": 1608370861,
"id": 2,
"type": "come_back"
},
{
"at": 1608370869,
"id": 3,
"type": "unfollow"
},
{
"at": 1608370874,
"id": 4,
"type": "duo"
},
{
"at": 1608370880,
"id": 5,
"type": "come_back"
},
{
"at": 1608370890,
"id": 6,
"type": "double_click_like"
},
{
"at": 1608370892,
"id": 7,
"type": "see_profile"
},
{
"at": 1608370895,
"id": 8,
"type": "come_back"
},
{
"at": 1608370900,
"id": 9,
},
{
"at": 1608370907,
"id": 10,
"type": "duo"
},
{
"at": 1608370911,
"id": 11,
"type": "come_back"
},
{
"at": 1608370914,
"id": 12,
"type": "dislike"
},
{
"at": 1608370924,
"id": 13,
"type": "see_profile"
},
{
"at": 1608370934,
"id": 14,
"type": "come_back"
}
],
"total_duos": 78,
"total_likes": 45477,
"total_shares": 1857,
"total_views": 4853,
"video_duration": 0.48587760432015425
}


# My solutions

## First one

At the beginning, I thought the best solution was to rate on /20. And for each type of interaction (liked, commented, etc…), give it a part of this final grade. What I mean:

 Liked: /10;
Commented: /2;
Shared: /5;
Followed: /3;
Total: /20


The problems is that if I use this method it won't really work. For example if I share, that means that I liked the post but if I don't that doesn't necessarily mean that I didn't like it. SO THIS WILL REMOVE 5 points because I didn't share.

## Second One

After that, I thought of making a deep RL algorithm based on human preferences.

The idea was that, I would create a client side website where a human can rate interactions. For this I created another algorithm that would create random interactions and then simulate them on the client side

BUT AFTER I WAS BLOCKED. Why ?

Well, because I SIMPLY DIDN'T KNOW HOW TO DO. There is nothing on the internet (except a really complex math document) on deep RL.

## Third Solution

Finally, the last solution that I found was to give a weight to each type of interaction.

THE THING IS THAT, how could I give a weight to something that depends on other interactions (time between last interaction, repetition, video duration, etc...)