Objective: Finding similar players to a given player based on cosine similarity
This is a short demo showing how the web application works:
Outline of the project -
- Convert the player features to standardised vectors. Player features are based on FIFA 19 dataset
- Find out the similarity or the cosine angle between the two vectors (of players), smaller the angle more is the similarity. The cosine similarity formula between two vectors is shown below:
where A and B are the two vectors of nth dimension.
The similarity of two vectors is measured by the cosine of the angle between them:
The similarity can take values between -1 and +1. Smaller angles between vectors produce larger cosine values, indicating greater cosine similarity. For example:
- When two vectors have the same orientation, the angle between them is 0, and the cosine similarity is 1.
- Perpendicular vectors have a 90-degree angle between them and a cosine similarity of 0.
- Opposite vectors have an angle of 180 degrees between them and a cosine similarity of -1.
- Based on the similarity scores, output the top 30 players