emanuelef / daily-stars-explorer

Gain deeper insights into your favourite open-source repositories. Explore star trends showing daily stars and go beyond the 40k-star limit.
https://emanuelef.github.io/daily-stars-explorer/
MIT License
83 stars 0 forks source link

Show the derivative of the star history curve #93

Closed Kerollmops closed 6 months ago

Kerollmops commented 6 months ago

Would it make sense to show the derivative of the star history curve? This corresponds to the acceleration of the curve (or acceleration) and would help spot the speed or slowdown of the number of stars on a repo.

Doing the difference between one point of the curve and the next one and showing this curve would probably make it too 🤔

emanuelef commented 6 months ago

Hi @Kerollmops, that's a good idea. I have a PR where I'm trying to get a good trend line, I tried LOESS but I guess there must be something better. I think for the acceleration I should use second derivative, curious to see how it looks like and if it's giving some indication.

emanuelef commented 6 months ago

@Kerollmops I've been working on adding some new data manipulation options, which I'm tentatively calling "transformations" for now. These include calculations for the first and second-order derivative. To further enhance trend identification, I'm also exploring alternatives to LOESS. Splines might be a promising approach.

The calculated derivatives exhibit significant noise, which unfortunately amplifies the existing noise present in the daily star data. To mitigate this issue, I might explore applying some smoothing techniques to the data before calculating the derivatives.

Running average now has a hardcoded 120 days size window, which might not be suitable for repos that have been created recently.

Any suggestion is welcome!

Kerollmops commented 6 months ago

I tried the feature on the meilisearch repository and found it hard to understand what all those curves mean and how they can be interpreted. What could be fantastic is a small description of how to read the blue curve.

Also, a good explanation of how the running median/average work could be interesting because, as I understand it, it becomes unusable on the far right points of the graph. Because it will only average/median the 60 points on the left of it.

Thank you very much for the great soft!

emanuelef commented 6 months ago

Hi, yes I'll add a description but for now those are just experiments. I'll probably keep only the ones that give some indication on the actual trend.

emanuelef commented 6 months ago

Added the ability to select different ways to aggregate or calculate the original data, this include the derivative: https://github.com/emanuelef/daily-stars-explorer/blob/main/aggregate.md#derivative

I created a discussion https://github.com/emanuelef/daily-stars-explorer/discussions/102 so it's possible to make other suggestions.