Tech
My Near-Perfect R2 Was Fake: Debugging a Speed and Distance Model
The result looked great: R2 of 0.9993 and a correlation of 0.9994 between speed and distance. The problem was that the data had no real relationship in it.
What the script does
Generates 1,000 random speed values (10 to 1,000) and 1,000 random distance values (100 to 10,000) independently with random.randint .
Sorts both arrays ascending, separately.
Pairs them by index into a DataFrame and saves speed_dist.csv .
Splits 97/3 into train and test (970 and 30 rows).
Fits...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to