instacart / wilson_score Goto Github PK
View Code? Open in Web Editor NEWSimple, dependency-free Wilson score
License: MIT License
Simple, dependency-free Wilson score
License: MIT License
I get Math::DomainError: Numerical argument is out of domain - "sqrt"
when running:
WilsonScore.rating_lower_bound(1, 100, 1..5, confidence: 0.12)
or
WilsonScore.rating_lower_bound(5, 25, 1..5, confidence: 0.8)
but not when running:
WilsonScore.rating_lower_bound(2, 100, 1..5, confidence: 0.12)
Right now, it returns an obscure error:
WilsonScore.lower_bound(0,0)
# => ArgumentError: comparison of Float with 0 failed
# from <gem>/wilson_score-0.1.0/lib/wilson_score.rb:20:in `each'
That means all apps that can possibly take 0 as the second parameter must special case it. It's not even ZeroDivisionError
.
Two possible solutions:
WilsonScore::Error
when 0 is given for the second parameter.If you give me a direction, I can prepare a pull request.
WilsonScore.lower_bound(2, 5, confidence: 0.99, correction: false)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.