Question: I need help with normalization in java, my method is not properly ignoring zeros and im not sure why, here is the method: protected void
I need help with normalization in java, my method is not properly ignoring zeros and im not sure why, here is the method: protected void normalizeRatingsByUserList ratings
for int user ; user ratings.getlength; user
double sum ;
int count ;
for double rating : ratings
if ratinguser
sum ratinguser;
count;
if count
double mean sum count;
for double rating : ratings
if ratinguser
ratinguser mean;
and here is my unit test: @Test
public void testNormalizationIgnoresZeros
Project.SongClusterer clusterer new Project.SongClusterer;
List ratings Arrays.asList
new double
new double
; and here is the output from the test: "Failed to map supported failure 'org.opentestjAssertionFailedError: Ratings should be normalized correctly ignoring zeros. array contents differ at index expected: but was: with mapper please help me fix my normalization im unsure why it wont ignore zeros properly and do not use chatgpt GPT can not solve this problem otherwise i wouldnt be here, will upvote if you can help me get it working!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
