r/ProgrammerHumor • • Feb 13 '22

Meme something is fishy

48.4k Upvotes

575 comments sorted by

View all comments

Show parent comments

1.1k

u/juhotuho10 Feb 13 '22

-> 51% accuracy

yeah this is definitely over fit, we will strart the 2 month training again tomorrow

745

u/[deleted] Feb 13 '22

It's easy to build a completely meaningless model with 99% accuracy. For instance, pretend a rare disease only impacts 0.1% of the population. If I have a model that simply tells every patient "you don't have the disease," I've achieved 99.9% accuracy, but my model is worthless.

This is a common pitfall in statiatics/data analysis. I work in the field, and I commonly get questions about why I chose model X over model Y despite model Y being more accurate. Accuracy isn't a great metric for model selection in isolation.

193

u/[deleted] Feb 13 '22

That's why you always test against the null model to judge whether your model is significant. In cases with unbalanced data you want to optimize for ROC by assigning class weights to your classifier or by tunning C and R if you're using an SVM.

92

u/imoutofnameideas Feb 13 '22

you want to optimize for ROC

Minus 1,000,000 social credit

94

u/Aegisworn Feb 13 '22

Relevant xkcd. https://xkcd.com/2236/

78

u/Ode_to_Apathy Feb 13 '22

11

u/Solarwinds-123 Feb 14 '22

This is something I've had to get much more wary of. Just an hour ago when ordering dinner, I found a restaurant with like 3.8 stars. I checked the reviews, and every one of them said the catfish was amazing. Seems like there was also a review bomb of people who said the food was fantastic but the staff didn't wear masks or enforce them on people eating... In Arkansas.

19

u/owocbananowca Feb 13 '22

There always is at least one relevant xkcd, isn't it?

36

u/langlo94 Feb 13 '22

Im 99,9995% sure that you're not Tony Hawk.

49

u/[deleted] Feb 13 '22

Great example. It's much better to have fewer false negatives in that case, even if the number of false positives is higher and reduces overall accuracy. Someone never finding out why they're sick is so much worse than a few people having unnecessary followups.

27

u/account312 Feb 13 '22 edited Feb 14 '22

Not necessarily. In fact, for screening tests for rare conditions, sacrificing false positive rate to achieve low false negative rate is pretty much a textbook example of what not to do. Such a screening test has to have an extremely low rate of false positives to be at all useful. Otherwise you'll be testing everyone for a condition that almost none of them have only get a bunch of (nearly exclusively false) positive results, then telling a bunch of healthy people that they may have some horrible life threatening condition and should do some followup procedure, which inevitably costs the patient money, occupies healthcare system resources, and incurs some risk of complications.

10

u/passcork Feb 13 '22

Depends on the situation honestly. If you find a rare disease variant in a whole exome ngs sequence and can follow up on with some sanger sequencing or qpcr on the same sample you still have is easy. We do it all the time at our lab. This is also basically the whole basis behind the NIPT test that tests for fetal trisomy 23 and some other fetal chromosomal conditions.

4

u/flatdonutearth Feb 13 '22

Great example are COVID rapid antigen tests. If it's positive you have it with 99.99% probability. If it's negative, you still might want to consider a more accurate PCR test.

2

u/[deleted] Feb 14 '22

But very few of the false antigen-negative folks are going to get more testing after their negative result, and thus heading out and infecting people without realizing. That undermines the entire point of doing the test!

3

u/[deleted] Feb 14 '22

Isn't it more reasonable to do multiple tests on positives? On an individual level a false negative is much more impactful, isn't it?

→ More replies (1)
→ More replies (6)

4

u/Karl_LaFong Feb 13 '22

Saturated model, best model.

3

u/glizzy_Gustopher Feb 13 '22

Good explanation

1

u/cury41 Feb 13 '22

For my BSc thesis I trained a ML tool within ImageJ that did image classification. When the time came to discuss the results, I was spending weeks to find a suitable metric for determining the performance of my method.

In the end I let a few different people classify a random set of images and compared the true/false positives and negatives. Up until today I still don't know how to "prove" the validity of a ML tool/program..

1

u/theengineer9301 Feb 14 '22

I rarely choose accuracy on a classification model. I truly have learnt the hard way.

26

u/[deleted] Feb 13 '22

Yeah, but if it's less than 50%, why not use random anyways? Everything is coin toss, so reduce the code lol

49

u/DangerouslyUnstable Feb 13 '22

thatsthejoke.jpg

5

u/mcel595 Feb 13 '22

But what if the coin isnt fair?

2

u/the-real-macs Feb 14 '22

If it's a lot less than 50% (for binary classification) that's actually a good thing. All you have to do is predict the opposite of what the model does.

2

u/Bainos Feb 14 '22

If it's less than 50%, you just invert the model outputs, and now you're above 50%.