Skip to content
Dashboard

Curve fitting for charts: better visualizations for Vercel Analytics

Software Engineer

Link to headingBefore and after

It is difficult to find trends in a graph with a lot of noise.It is difficult to find trends in a graph with a lot of noise.
It is difficult to find trends in a graph with a lot of noise.
A best fit line shows the graph's trend at a glance.A best fit line shows the graph's trend at a glance.
A best fit line shows the graph's trend at a glance.

Link to headingThe challenge

The first and final points of the graph don't tell an accurate story for the whole dataset.
The first and final points of the graph don't tell an accurate story for the whole dataset.

Link to headingA better way

The palmerspenguins dataset is quite random and trends may not be obvious at first glance.
A linear regression can give a quick and naive trend for a chart.
A quadratic dataset with an order of 2.

Link to headingThe "good" fit

Finding "best fit" using a training set and a test set.
A chart showing "best fit" gives us a value of 2.

Link to headingTry it out

Ready to deploy?