Set a "Maxium Value" in the target value

Hey guys,
I have a quick question while doing the course project. As I have a project to predict “how much a person likes a song by giving a rating from 0 to 100”. I was wondering how can I impose a “Maximum value” in the predictions y, as values beyond 100 doesn’t make sense.
I tried to google it but got no answer so far.

Thanks a lot for the help.

Try checking the dataframe for any prediction values > 100 and set them to 100

So manually basically, ehehe ok!

Maybe someone else might have a more elegant solution

1 Like

If it were a regression problem (and it probably isn’t, as you are modeling discrete values in the range 1-100) you could use something like Tobit Regression - this is when your dependent variable is “censored” or cut-off, or in your case bound to be less than or equal to 100. If you google that you may get a solution to the classification-equivalent problem.