Module Mal4J

Class MyAnimeListAffinityAlgorithm

java.lang.Object
dev.katsute.mal4j.user.property.MyAnimeListAffinityAlgorithm
All Implemented Interfaces:
AffinityAlgorithm

public final class MyAnimeListAffinityAlgorithm extends Object implements AffinityAlgorithm
The MyAnimeList affinity algorithm.
Pearson Correlation Coefficient (sample)
Since:
2.3.0
Version:
2.4.0
Author:
Katsute
See Also:
  • 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 interface AffinityAlgorithm
      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