321-PoM / findmy

Android app with Google Maps API integration for saving POIs (points of interest) around school campus and sharing POIs with friends
0 stars 1 forks source link

Reliability Score Implementation #151

Open kevinzhao-tech opened 1 year ago

kevinzhao-tech commented 1 year ago

Maybe the logic could be smth like this, using pseudocode:

createReview(Review[] reviews, incomingReview) {
    for (review : reviews) {
      initialRating = review.rating;
      dTime = initialRating.time - curTime
      timeBias =  e^(-2 * dTime) // this creates a time bias s.t. if the poi was just created, this review has full effect, as time goes on later reviews have less of a effect on the owner's rScore

      adjustment = -abs(review.rating - initialRating) + 2
      adjustReviewerScore(review.creator, adjustment * timeBias)
  }
}

adjustReviewerScore(creator, adjustment) {
     adjustment *= 5; // adjustment is now in the range of (0, 10)
     creator.rScore = min(0, max(100, creator.rScore+adjustment))
}

showing the overall rating uses the weighted average of the reviews using the reviewer's reliability score as a weight

getRating(poi) {
    reviews =  poi.getReviews()
    weightedSum = 0;
    sumOfWeights = 0;
    for (review in reviews) {
         weightedSum += review.rating * review.rScore;
         sumOfWeights += review.rScore;
    }
    return weightedSum / sumOfWeights
}
kevinzhao-tech commented 1 year ago

This is what the timeBias function looks like. As time goes on (in hours) the bias is less and approaches 0 image

kevinzhao-tech commented 1 year ago

This is what adjustment looks like. If the review delta is less than two, the creator would see an increase of score, otherwise an decrease image

kevinzhao-tech commented 1 year ago

image

muhan-alan-li commented 1 year ago

https://github.com/321-PoM/findmy/issues/216

Please test with this issue ^