theastropath / turbot

A Discord bot for tracking Animal Crossing: New Horizons turnip prices and fossil collections
MIT License
8 stars 1 forks source link

Smooth prediction graph #152

Open lexicalunit opened 4 years ago

lexicalunit commented 4 years ago

We may be able to generate a smooth nicer looking graph:

  1. Use turnips lib to generate the lines and collections.
  2. Iterate over those lines and collections to find the min and max for each day and time of day.
  3. Completely blank out the data on the plot.
  4. Put all the min and max points into a scatter on the plot.
  5. Draw a spline for the the line defined by the min points.
  6. Draw another spline for the line defined by the max points.
  7. Fill between the two splines.

As for how to calculate the spline, it's something that scipy could do but that's a huge dependency. An alternative is to directly implement it wth numpy as shown here: https://stackoverflow.com/questions/31543775/how-to-perform-cubic-spline-interpolation-in-python/48085583#48085583

lexicalunit commented 4 years ago

The more I look at the non-smooth graphs we have now, the more I like them over the smooth one that you get on turnipprophet.io. You can actually see the different models in the graph, especially when you've narrowed it down to two or three. It lets you know when the important times to capture data are, the points that will let you immediately eliminate one or more models.