java.lang.Object
dev.katsute.mal4j.user.property.MyAnimeListAffinityAlgorithm
- All Implemented Interfaces:
AffinityAlgorithm
The MyAnimeList affinity algorithm.
Pearson Correlation Coefficient (sample)
Pearson Correlation Coefficient (sample)
- Since:
- 2.3.0
- Version:
- 2.4.0
- Author:
- Katsute
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal float
getAffinity
(int[] a_scores, int[] b_scores) Returns affinity between two linked score sets.
-
Constructor Details
-
MyAnimeListAffinityAlgorithm
public MyAnimeListAffinityAlgorithm()
-
-
Method Details
-
getAffinity
public final float getAffinity(int[] a_scores, int[] b_scores) Returns affinity between two linked score sets.- Specified by:
getAffinity
in interfaceAffinityAlgorithm
- Parameters:
a_scores
- shared scores for first user (in same order as second user)b_scores
- shared scores for second user (in same order as first user)- Returns:
- affinity as a float (100% = 1f; 50% = .5f)
- Throws:
IllegalArgumentException
- if array lengths are not the same- Since:
- 2.3.0
-