LAB - Bringind it all together

May we use this values?
{ $subtract: ["$imdb.votes", 5] },
{ $subtract: [1521105, 5] }

Why we need min =1 and max = 10 ?

Thanks !!

@xgubianas

Sorry, but I really don’t understand where you got “…min = 1 and max = 10…” from. The download handout shows (I think) pretty clearly what values you need to use. If you can explain your question a bit more, we’ll try to help.

I think that “min = 1” comes from line 15 and “max = 10” comes from line 16 of scaling.js.

Can you confirm that the following is the case, please?
min and max are the two values that define the range that you are going to map, or normalize, all the imdb.votes into.
x_min and x_max are the range that imdb.votes currently fall into.
x is the value of imdb.votes that is to b transformed.

Thus, interpreting from the data on lines 13 to 17:
13) 1521105 is the largest value for imdb.votes in the movies collection.
14) 5 is the smallest value for imdb.votes in the movies collection.
15) 1 is the smallest value we want in our transformed rating
16) 10 is the largest value we want in our transformed rating
17) x is the value for imdb.votes in the current document

@Paul_82832

Ahh, yes thanks. And yes, those are exactly the correct values. Good luck.