Git Product home page Git Product logo

quickstats's People

Contributors

dndubins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

quickstats's Issues

Equality relation for floats

Equality comparison doesn't really make sense for floats since floating point values are not exact. Normally you would compare the difference towards a small value, such as:

sorted[i]-sorted[i-1] > 0.00001

The constant is usually called an epsilon and can be chosen differently depending on context.

It would probably be best to compare to the first number in the current series (sorted[i]-sorted[firstInSeries]). And perhaps allow the user to specify the epsilon value as a function argument.

Mode not counting correctly

Hi just went to use the library as it has the mode function I was looking for. However, I noticed that it wasn't counting the number of times a variable was present in array correctly.

I found a fix. By adding a new variable into the mode function
int pw = 0;
Changing the If state below in the for loop
if(abs(sorted[i]-sorted[pw]) < epsilon)
And then adding the below line into the else statement
np = i;

This seemed to fix my issue. I have tested it outside what I'm trying to do so I'm not if there will be conditions that break the code.
Hope this helps
Jack

some recommendations for distance sensor

awesome lib! I am using it for a distance sensor, I wonder if I can get some advice:

  1. distance goes from the distance +/- 2, i.e. imagine distance is 50, values would be 49, 50, 51... and 5% of erratic values like 5 and 784 (max limit)

mode with 0.001 gives a quite steady value, but I am afraid of if I get 0, should I add a "mean" after mode just in case? or it would be better to use gmdn? any recommendation for the third parameter considering my numbers?

How to handle NaN?

Continuing this from #2

One thing I realized later was that I never test for NaN values, and they will crash the functions. I debated filtering for NaN values in the routines, but then decided that this is probably something that should be done prior to statistics.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.